Class: EasyUpnp::OptionsBase::Builder
- Inherits:
-
Object
- Object
- EasyUpnp::OptionsBase::Builder
- Defined in:
- lib/easy_upnp/options_base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(supported_options) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(supported_options) ⇒ Builder
Returns a new instance of Builder.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/easy_upnp/options_base.rb', line 6 def initialize() @options = {} .each do |k| define_singleton_method("#{k}=") { |v| @options[k] = v } define_singleton_method("#{k}") do |&block| @options[k] = block if block @options[k] end end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/easy_upnp/options_base.rb', line 4 def @options end |