Class: ForestRails::Collection

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Serialization, ActiveModel::Validations
Defined in:
app/models/forest_rails/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Collection

Returns a new instance of Collection.



11
12
13
14
15
# File 'app/models/forest_rails/collection.rb', line 11

def initialize(attributes = {})
  attributes.each do |name, value|
    send("#{name}=", value)
  end
end

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



9
10
11
# File 'app/models/forest_rails/collection.rb', line 9

def fields
  @fields
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'app/models/forest_rails/collection.rb', line 9

def name
  @name
end

Instance Method Details

#idObject



21
22
23
# File 'app/models/forest_rails/collection.rb', line 21

def id
  name
end

#persisted?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/forest_rails/collection.rb', line 17

def persisted?
  false
end