Class: BigShift::TableField

Inherits:
BaseModel show all
Defined in:
lib/big_shift/models/table_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_json

Constructor Details

#initialize(field_name, field_type) ⇒ TableField

Returns a new instance of TableField.



6
7
8
9
# File 'lib/big_shift/models/table_field.rb', line 6

def initialize(field_name, field_type)
  @field_name = field_name
  @field_type = field_type
end

Instance Attribute Details

#field_nameObject (readonly)

Returns the value of attribute field_name.



3
4
5
# File 'lib/big_shift/models/table_field.rb', line 3

def field_name
  @field_name
end

#field_typeObject (readonly)

Returns the value of attribute field_type.



4
5
6
# File 'lib/big_shift/models/table_field.rb', line 4

def field_type
  @field_type
end

Instance Method Details

#as_json(json_state = nil) ⇒ Object



11
12
13
14
15
16
# File 'lib/big_shift/models/table_field.rb', line 11

def as_json(json_state = nil)
  {
    :name => @field_name,
    :type => @field_type,
  }
end