typhoid 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,18 +55,18 @@ module Typhoid
55
55
 
56
56
  # Need to force override, because Object#method
57
57
  def method
58
- source.respond_to?(:method) && source.method || options[:method] || :get
58
+ options[:method] || :get
59
59
  end
60
60
 
61
61
  def options
62
- if source.respond_to?(:options)
63
- source.options
64
- else
65
- ACCESSOR_OPTIONS.reduce({}) do |hash, key|
66
- hash[key] = source.send(key) if source.respond_to?(:key)
67
- hash
68
- end
69
- end
62
+ @options ||= if source.respond_to?(:options)
63
+ source.options
64
+ else
65
+ ACCESSOR_OPTIONS.reduce({}) do |hash, key|
66
+ hash[key] = source.send(key) if source.respond_to?(key) && source.class.instance_method(key).arity < 1
67
+ hash
68
+ end
69
+ end
70
70
  end
71
71
  end
72
72
  end
@@ -1,3 +1,3 @@
1
1
  module Typhoid
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typhoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-09 00:00:00.000000000 Z
13
+ date: 2013-08-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
@@ -134,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  segments:
136
136
  - 0
137
- hash: 1764376195889055492
137
+ hash: -4381647444060955036
138
138
  required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  segments:
145
145
  - 0
146
- hash: 1764376195889055492
146
+ hash: -4381647444060955036
147
147
  requirements: []
148
148
  rubyforge_project:
149
149
  rubygems_version: 1.8.24