Class: Retab::WorkflowTableColumn
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::WorkflowTableColumn
- Defined in:
- lib/retab/tables/workflow_table_column.rb
Constant Summary collapse
- HASH_ATTRS =
{ name: :name, json_schema: :json_schema, sample_values: :sample_values, required: :required, unique: :unique }.freeze
Instance Attribute Summary collapse
-
#json_schema ⇒ Object
Returns the value of attribute json_schema.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#sample_values ⇒ Object
Returns the value of attribute sample_values.
-
#unique ⇒ Object
Returns the value of attribute unique.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ WorkflowTableColumn
constructor
A new instance of WorkflowTableColumn.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ WorkflowTableColumn
Returns a new instance of WorkflowTableColumn.
24 25 26 27 28 29 30 31 32 |
# File 'lib/retab/tables/workflow_table_column.rb', line 24 def initialize(json) super() hash = self.class.normalize(json) @name = hash[:name] @json_schema = hash[:json_schema] || {} @sample_values = (hash[:sample_values] || []) @required = hash[:required].nil? ? false : hash[:required] @unique = hash[:unique].nil? ? false : hash[:unique] end |
Instance Attribute Details
#json_schema ⇒ Object
Returns the value of attribute json_schema.
16 17 18 |
# File 'lib/retab/tables/workflow_table_column.rb', line 16 def json_schema @json_schema end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/retab/tables/workflow_table_column.rb', line 16 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
16 17 18 |
# File 'lib/retab/tables/workflow_table_column.rb', line 16 def required @required end |
#sample_values ⇒ Object
Returns the value of attribute sample_values.
16 17 18 |
# File 'lib/retab/tables/workflow_table_column.rb', line 16 def sample_values @sample_values end |
#unique ⇒ Object
Returns the value of attribute unique.
16 17 18 |
# File 'lib/retab/tables/workflow_table_column.rb', line 16 def unique @unique end |