Module: Backline::Model
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Model, Attributes, Persistence
- Defined in:
- lib/backline/model.rb,
lib/backline/model/attributes.rb,
lib/backline/model/persistence.rb,
lib/backline/model/attributes/attribute.rb
Defined Under Namespace
Modules: Attributes, Persistence
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
Methods included from Attributes
#attributes, #read_attribute, #write_attribute
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
24 25 26 |
# File 'lib/backline/model.rb', line 24 def id @id end |
Instance Method Details
#initialize(attributes = {}) {|_self| ... } ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/backline/model.rb', line 14 def initialize(attributes = {}) attributes.each do |name, value| method = "#{name}=" raise(Backline::UnknownAttribute.new(self.class, name)) unless respond_to?(method) public_send(method, value) end yield self if block_given? end |