Class: EasyUpnp::OptionsBase::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_upnp/options_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(supported_options)
  @options = {}

  supported_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

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/easy_upnp/options_base.rb', line 4

def options
  @options
end