Class: ActiveViewModel::Base
- Inherits:
-
Object
- Object
- ActiveViewModel::Base
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/activeviewmodel/base.rb
Instance Method Summary collapse
-
#initialize(attributes = {}) {|_self| ... } ⇒ Base
constructor
A new instance of Base.
- #persisted? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) {|_self| ... } ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 |
# File 'lib/activeviewmodel/base.rb', line 7 def initialize(attributes = {}) attributes ||= {} attributes.each do |name, value| send("#{name}=", value) end yield(self) if block_given? end |
Instance Method Details
#persisted? ⇒ Boolean
16 17 18 |
# File 'lib/activeviewmodel/base.rb', line 16 def persisted? false end |