Class: Inkdit::Entity
Overview
Represents an Inkdit Entity.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#contracts_link ⇒ Object
the URL of this entity’s Contract Collection.
-
#get_contracts ⇒ Array<Contract>
retrieves this entity’s Contract Collection.
-
#html_link ⇒ Object
the URL of this entity’s HTML representation.
- #inspect ⇒ Object
-
#label ⇒ Object
this entity’s human-readable name.
-
#type ⇒ Object
this entity’s type.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Inkdit::Resource
Instance Method Details
#contracts_link ⇒ Object
the URL of this entity’s Contract Collection
20 21 22 |
# File 'lib/inkdit/entity.rb', line 20 def contracts_link @params['links']['contracts'] end |
#get_contracts ⇒ Array<Contract>
retrieves this entity’s Contract Collection
26 27 28 29 30 31 32 33 |
# File 'lib/inkdit/entity.rb', line 26 def get_contracts response = @client.get(contracts_link) raise Inkdit::Error.new(response) unless response.status == 200 response.parsed['resources'].map do |contract_params| Contract.new @client, contract_params end end |
#html_link ⇒ Object
the URL of this entity’s HTML representation.
15 16 17 |
# File 'lib/inkdit/entity.rb', line 15 def html_link @params['links']['html'] end |
#inspect ⇒ Object
35 36 37 |
# File 'lib/inkdit/entity.rb', line 35 def inspect "#<Inkdit::Entity type=#{type} label=#{label}>" end |
#label ⇒ Object
this entity’s human-readable name.
10 11 12 |
# File 'lib/inkdit/entity.rb', line 10 def label @params['label'] end |
#type ⇒ Object
this entity’s type. ‘individual’ or ‘organization’.
5 6 7 |
# File 'lib/inkdit/entity.rb', line 5 def type @params['type'] end |