Module: AudioAddict::AutoProperties

Included in:
Channel, Track
Defined in:
lib/audio_addict/auto_properties.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *args) ⇒ Object



5
6
7
# File 'lib/audio_addict/auto_properties.rb', line 5

def method_missing(method_sym, *args, &)
  respond_to?(method_sym) ? properties[method_sym.to_s] : super
end

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



3
4
5
# File 'lib/audio_addict/auto_properties.rb', line 3

def properties
  @properties
end

Instance Method Details

#respond_to_missing?(method_sym, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/audio_addict/auto_properties.rb', line 9

def respond_to_missing?(method_sym, _include_private = false)
  properties.has_key?(method_sym.to_s) || super
end