Class: Billy::BaseModel

Inherits:
Object
  • Object
show all
Defined in:
lib/billy/base_model.rb

Direct Known Subclasses

Invoice, Service, SignupToken

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/billy/base_model.rb', line 3

def attributes
  @attributes
end