Class: Billy::BaseModel
- Inherits:
-
Object
- Object
- Billy::BaseModel
- Defined in:
- lib/billy/base_model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BaseModel
constructor
A new instance of BaseModel.
- #method_missing(param) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ BaseModel
Returns a new instance of BaseModel.
5 6 7 |
# File 'lib/billy/base_model.rb', line 5 def initialize(attributes = {}) @attributes = attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(param) ⇒ Object
9 10 11 |
# File 'lib/billy/base_model.rb', line 9 def method_missing(param) @attributes[param.to_s] || super end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/billy/base_model.rb', line 3 def attributes @attributes end |