Class: Nexmo::HTTP::Options
- Inherits:
-
Object
- Object
- Nexmo::HTTP::Options
- Defined in:
- lib/nexmo/http.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ Options
constructor
A new instance of Options.
- #set(http) ⇒ Object
Constructor Details
#initialize(hash) ⇒ Options
Returns a new instance of Options.
7 8 9 10 11 12 13 14 15 |
# File 'lib/nexmo/http.rb', line 7 def initialize(hash) @hash = hash || {} @hash.each_key do |name| next if .key?(name) raise ArgumentError, "#{name.inspect} is not a valid option" end end |
Instance Method Details
#set(http) ⇒ Object
17 18 19 20 21 |
# File 'lib/nexmo/http.rb', line 17 def set(http) @hash.each do |name, value| http.public_send(.fetch(name), value) end end |