Class: Kangaroo::Model::Field

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/kangaroo/model/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Attributes

#attributes, #attributes=, #freeze, #read_attribute, #write_attribute

Constructor Details

#initialize(name, attributes = {}) ⇒ Field

Returns a new instance of Field.



15
16
17
18
19
20
21
22
# File 'lib/kangaroo/model/field.rb', line 15

def initialize name, attributes = {}
  @attributes = {}
  @name = name
  
  attributes.each do |key, val|
    write_attribute key, val
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/kangaroo/model/field.rb', line 8

def name
  @name
end