Class: OpConnect::Item::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/op_connect/item/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Field

Returns a new instance of Field.



8
9
10
11
12
13
14
15
16
# File 'lib/op_connect/item/field.rb', line 8

def initialize(options = {})
  @id = options["id"]
  @purpose = options["purpose"] if options["purpose"]
  @type = options["type"] if options["type"]
  @value = options["value"]
  @should_generate = options["generate"] || false
  @recipe = GeneratorRecipe.new(options["recipe"])
  @section = Object.new(options["section"])
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def id
  @id
end

#purposeObject (readonly)

Returns the value of attribute purpose.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def purpose
  @purpose
end

#recipeObject (readonly)

Returns the value of attribute recipe.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def recipe
  @recipe
end

#sectionObject (readonly)

Returns the value of attribute section.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def section
  @section
end

#should_generateObject (readonly) Also known as: generate?

Returns the value of attribute should_generate.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def should_generate
  @should_generate
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/op_connect/item/field.rb', line 4

def value
  @value
end