Class: Article
- Inherits:
-
Object
- Object
- Article
- Extended by:
- ActiveModel::Naming
- Defined in:
- lib/prototype_legacy_helper/test/test_prototype_helper.rb
Instance Attribute Summary collapse
-
#author_id ⇒ Object
readonly
Returns the value of attribute author_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
Instance Attribute Details
#author_id ⇒ Object (readonly)
Returns the value of attribute author_id.
32 33 34 |
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 32 def @author_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
31 32 33 |
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 31 def id @id end |
Instance Method Details
#name ⇒ Object
35 36 37 |
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 35 def name @id.nil? ? 'new article' : "article ##{@id}" end |
#new_record? ⇒ Boolean
34 |
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 34 def new_record?; @id.nil? end |
#save ⇒ Object
33 |
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 33 def save; @id = 1; @author_id = 1 end |