Class: Bronto::Field

Inherits:
Base show all
Defined in:
lib/bronto/field.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api_key, #errors

Instance Method Summary collapse

Methods inherited from Base

api, api_key, api_key=, #create, create, #destroy, destroy, find, #initialize, plural_class_name, #reload, request, #request, #save, save, soap_header, update, #update

Constructor Details

This class inherits a constructor from Bronto::Base

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/bronto/field.rb', line 3

def id
  @id
end

#labelObject

Returns the value of attribute label.



3
4
5
# File 'lib/bronto/field.rb', line 3

def label
  @label
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/bronto/field.rb', line 3

def name
  @name
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/bronto/field.rb', line 3

def type
  @type
end

#visibilityObject

Returns the value of attribute visibility.



3
4
5
# File 'lib/bronto/field.rb', line 3

def visibility
  @visibility
end

Instance Method Details

#to_hashObject



5
6
7
8
9
# File 'lib/bronto/field.rb', line 5

def to_hash
  hash = { name: name, label: label, type: type, visibility: visibility }
  hash[:id] = id if id.present?
  hash
end