Sha256: 7dc22e04298125330f502d71f414da0b1714a1a14394dd5d7259d1246285c144

Contents?: true

Size: 643 Bytes

Versions: 7

Compression:

Stored size: 643 Bytes

Contents

module MyJohnDeere
  class Organization < SingleResource
    self.base_jd_resource = "organizations"
    self.list_resource_path = self.base_jd_resource
    self.retrieve_resource_path = self.base_jd_resource
    attributes_to_pull_from_json(:id, :name, :type, :member)

    def initialize(json_object, access_token = nil)
      super(json_object, access_token)
    end

    def has_access_to_boundaries?
      self.has_access_to?("boundaries")
    end

    def has_access_to_fields?
      self.has_access_to?("fields")
    end

    def fields
      return MyJohnDeere::Field.list(self.access_token, organization_id: self.id)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
myjohndeere-0.1.11 lib/myjohndeere/organization.rb
myjohndeere-0.1.10 lib/myjohndeere/organization.rb
myjohndeere-0.1.9 lib/myjohndeere/organization.rb
myjohndeere-0.1.8 lib/myjohndeere/organization.rb
myjohndeere-0.1.7 lib/myjohndeere/organization.rb
myjohndeere-0.1.6 lib/myjohndeere/organization.rb
myjohndeere-0.1.5 lib/myjohndeere/organization.rb