Class: MyJohnDeereApi::Request::Individual::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/my_john_deere_api/request/individual/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, id, associations = {}) ⇒ Base

Initialize with a client, and asset id



10
11
12
13
14
# File 'lib/my_john_deere_api/request/individual/base.rb', line 10

def initialize(client, id, associations = {})
  @client = client
  @id = id
  @associations = associations
end

Instance Attribute Details

#associationsObject (readonly)

Returns the value of attribute associations.



5
6
7
# File 'lib/my_john_deere_api/request/individual/base.rb', line 5

def associations
  @associations
end

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/my_john_deere_api/request/individual/base.rb', line 5

def client
  @client
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/my_john_deere_api/request/individual/base.rb', line 5

def id
  @id
end

Instance Method Details

#objectObject

The object being requested, an asset in this case



19
20
21
22
# File 'lib/my_john_deere_api/request/individual/base.rb', line 19

def object
  return @object if defined?(@object)
  @object = model.new(client, response)
end