class MyJohnDeereApi::Model::Field
Attributes
name[R]
Public Instance Methods
archived?()
click to toggle source
Since the archived attribute is boolean, we reflect this in the method name instead of using a standard attr_reader.
# File lib/my_john_deere_api/model/field.rb, line 9 def archived? @archived end
flags()
click to toggle source
flags associated with this organization
# File lib/my_john_deere_api/model/field.rb, line 16 def flags return @flags if defined?(@flags) @flags = Request::Collection::Flags.new(client, organization: organization_id, field: id) end
Private Instance Methods
expected_record_type()
click to toggle source
# File lib/my_john_deere_api/model/field.rb, line 28 def expected_record_type 'Field' end
map_attributes(record)
click to toggle source
# File lib/my_john_deere_api/model/field.rb, line 23 def map_attributes(record) @name = record['name'] @archived = record['archived'] end
organization_id()
click to toggle source
Infer the organization_id
from the 'self' link
# File lib/my_john_deere_api/model/field.rb, line 35 def organization_id return @organization_id if defined?(@organization_id) @organization_id = id_from_uri(links['self'], :organizations) end