Class: Savon::Options
- Inherits:
-
Object
show all
- Defined in:
- lib/savon/options.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
7
8
9
10
|
# File 'lib/savon/options.rb', line 7
def initialize(options = {})
@options = {}
assign options
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(option, _) ⇒ Object
39
40
41
|
# File 'lib/savon/options.rb', line 39
def method_missing(option, _)
raise UnknownOptionError, "Unknown #{option_type} option: #{option.inspect}"
end
|
Instance Attribute Details
#option_type ⇒ Object
Returns the value of attribute option_type.
16
17
18
|
# File 'lib/savon/options.rb', line 16
def option_type
@option_type
end
|
Instance Method Details
#[](option) ⇒ Object
18
19
20
|
# File 'lib/savon/options.rb', line 18
def [](option)
@options[option]
end
|
#[]=(option, value) ⇒ Object
22
23
24
25
|
# File 'lib/savon/options.rb', line 22
def []=(option, value)
value = [value].flatten
self.send(option, *value)
end
|
#deprecate(option) ⇒ Object
#include?(option) ⇒ Boolean
27
28
29
|
# File 'lib/savon/options.rb', line 27
def include?(option)
@options.key? option
end
|