class MyJohnDeereApi::Request::Individual::Base

Attributes

associations[R]
client[R]
id[R]

Public Class Methods

new(client, id, associations = {}) click to toggle source

Initialize with a client, and asset id

# File lib/my_john_deere_api/request/individual/base.rb, line 10
def initialize(client, id, associations = {})
  @client = client
  @id = id
  @associations = associations
end

Public Instance Methods

object() click to toggle source

The object being requested, an asset in this case

# 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

Private Instance Methods

response() click to toggle source

response from object request

# File lib/my_john_deere_api/request/individual/base.rb, line 29
def response
  return @response if defined?(@response)
  @response = client.get(resource)
end