Class: Author

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
ActiveModel::Naming
Defined in:
lib/acts_as_versioned/test/fixtures/page.rb,
lib/prototype_legacy_helper/test/test_prototype_helper.rb

Direct Known Subclasses

Nested

Defined Under Namespace

Classes: Nested

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



20
21
22
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 20

def id
  @id
end

Instance Method Details

#nameObject



23
24
25
# File 'lib/prototype_legacy_helper/test/test_prototype_helper.rb', line 23

def name
  @id.nil? ? 'new author' : "author ##{@id}"
end

#new_record?Boolean

Returns:

  • (Boolean)


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

def new_record?; @id.nil? end

#saveObject



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

def save; @id = 1 end