Sha256: 27a5ac7783ee394bde843eb0445b068e205e0e0ffd4d86441ca27ffd663c45ec

Contents?: true

Size: 763 Bytes

Versions: 12

Compression:

Stored size: 763 Bytes

Contents

module MyJohnDeere
  class Boundary < OrganizationOwnedResource
    self.base_jd_resource = "boundaries"
    self.list_resource_path = "organizations/%{organization_id}/fields/%{field_id}/#{self.base_jd_resource}"
    self.retrieve_resource_path = "organizations/%{organization_id}/#{self.base_jd_resource}"
    attributes_to_pull_from_json(:id, :name, :multipolygons, :active)
    attr_accessor :field_id

    def initialize(json_object, access_token = nil, field_id = nil)
      super(json_object, access_token)
      self.field_id = field_id
      self.active = self.active.to_s.downcase == "true"
      # This doesn't exist currently, not sure why
      self.field_id ||= extract_link_with_rel_from_list("fields", /\/(\d+)\/(.+?)\/fields\Z/)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
myjohndeere-0.1.11 lib/myjohndeere/boundary.rb
myjohndeere-0.1.10 lib/myjohndeere/boundary.rb
myjohndeere-0.1.9 lib/myjohndeere/boundary.rb
myjohndeere-0.1.8 lib/myjohndeere/boundary.rb
myjohndeere-0.1.7 lib/myjohndeere/boundary.rb
myjohndeere-0.1.6 lib/myjohndeere/boundary.rb
myjohndeere-0.1.5 lib/myjohndeere/boundary.rb
myjohndeere-0.1.4 lib/myjohndeere/boundary.rb
myjohndeere-0.1.3 lib/myjohndeere/boundary.rb
myjohndeere-0.1.2 lib/myjohndeere/boundary.rb
myjohndeere-0.1.1 lib/myjohndeere/boundary.rb
myjohndeere-0.1.0 lib/myjohndeere/boundary.rb