Class: Retab::FormField

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/form_field.rb

Constant Summary collapse

HASH_ATTRS =
{
  bbox: :bbox,
  description: :description,
  type: :type,
  key: :key,
  value: :value
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ FormField

Returns a new instance of FormField.



23
24
25
26
27
28
29
30
# File 'lib/retab/workflow_artifacts/form_field.rb', line 23

def initialize(json)
  hash = self.class.normalize(json)
  @bbox = hash[:bbox] ? Retab::BBox.new(hash[:bbox]) : nil
  @description = hash[:description]
  @type = hash[:type]
  @key = hash[:key]
  @value = hash[:value]
end

Instance Attribute Details

#bboxObject

Returns the value of attribute bbox.



16
17
18
# File 'lib/retab/workflow_artifacts/form_field.rb', line 16

def bbox
  @bbox
end

#descriptionObject

Returns the value of attribute description.



16
17
18
# File 'lib/retab/workflow_artifacts/form_field.rb', line 16

def description
  @description
end

#keyObject

Returns the value of attribute key.



16
17
18
# File 'lib/retab/workflow_artifacts/form_field.rb', line 16

def key
  @key
end

#typeObject

Returns the value of attribute type.



16
17
18
# File 'lib/retab/workflow_artifacts/form_field.rb', line 16

def type
  @type
end

#valueObject

Returns the value of attribute value.



16
17
18
# File 'lib/retab/workflow_artifacts/form_field.rb', line 16

def value
  @value
end