Class: Responsys::Api::Object::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/responsys/api/object/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_name, field_type, custom = false, data_extraction_key = false) ⇒ Field

Returns a new instance of Field.



7
8
9
10
11
12
# File 'lib/responsys/api/object/field.rb', line 7

def initialize(field_name, field_type, custom = false, data_extraction_key = false)
  @field_name =  field_name
  @field_type = field_type
  @custom = custom
  @data_extraction_key = data_extraction_key
end

Instance Attribute Details

#customObject

Returns the value of attribute custom.



5
6
7
# File 'lib/responsys/api/object/field.rb', line 5

def custom
  @custom
end

#data_extraction_keyObject

Returns the value of attribute data_extraction_key.



5
6
7
# File 'lib/responsys/api/object/field.rb', line 5

def data_extraction_key
  @data_extraction_key
end

#field_nameObject

Returns the value of attribute field_name.



5
6
7
# File 'lib/responsys/api/object/field.rb', line 5

def field_name
  @field_name
end

#field_typeObject

Returns the value of attribute field_type.



5
6
7
# File 'lib/responsys/api/object/field.rb', line 5

def field_type
  @field_type
end

Instance Method Details

#to_apiObject



14
15
16
# File 'lib/responsys/api/object/field.rb', line 14

def to_api
  { fieldName: @field_name, fieldType: @field_type.to_api, custom: @custom, dataExtractionKey: @data_extraction_key }
end