Module: IControl::Base::Attributable::InstanceMethods

Defined in:
lib/icontrol/base/attributable.rb

Overview

:nodoc:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/icontrol/base/attributable.rb', line 23

def method_missing(method_name,*args,&block)
  if @attributes && @attributes.has_key?(method_name)
    return @attributes[method_name] 
  else
    super
  end 
end

Instance Method Details

#initialize(attributes = {}) ⇒ Object



19
20
21
# File 'lib/icontrol/base/attributable.rb', line 19

def initialize(attributes = {})
  @attributes = attributes || {}
end

#typeObject



15
16
17
# File 'lib/icontrol/base/attributable.rb', line 15

def type
  return @attributes[:type] || super
end