Class: Article

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Defined in:
lib/prototype_legacy_helper/test/test_prototype_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#author_idObject (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
  @author_id
end

#idObject (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

#nameObject



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

Returns:

  • (Boolean)


34
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 34

def new_record?; @id.nil? end

#saveObject



33
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 33

def save; @id = 1; @author_id = 1 end