Class: Ami
- Inherits:
-
Object
- Object
- Ami
- Defined in:
- lib/sproutr/ami.rb
Instance Method Summary collapse
-
#initialize(ami) ⇒ Ami
constructor
A new instance of Ami.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize(ami) ⇒ Ami
Returns a new instance of Ami.
2 3 4 5 6 7 |
# File 'lib/sproutr/ami.rb', line 2 def initialize(ami) ami.keys.each do |key| var = "@#{key}" self.instance_variable_set(var.to_sym, ami[key]) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
9 10 11 |
# File 'lib/sproutr/ami.rb', line 9 def method_missing(sym, *args, &block) self.instance_variable_get "@#{sym}".to_sym end |