Class: FrilansFinansAPI::Resource
- Inherits:
-
Object
- Object
- FrilansFinansAPI::Resource
- Defined in:
- lib/frilans_finans_api/resource.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #id ⇒ Object
-
#initialize(document) ⇒ Resource
constructor
A new instance of Resource.
- #self_link ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(document) ⇒ Resource
Returns a new instance of Resource.
5 6 7 |
# File 'lib/frilans_finans_api/resource.rb', line 5 def initialize(document) @data = document || {} end |
Instance Method Details
#attributes ⇒ Object
17 18 19 |
# File 'lib/frilans_finans_api/resource.rb', line 17 def attributes @data['attributes'] end |
#id ⇒ Object
13 14 15 |
# File 'lib/frilans_finans_api/resource.rb', line 13 def id @data['id'] end |
#self_link ⇒ Object
21 22 23 |
# File 'lib/frilans_finans_api/resource.rb', line 21 def self_link @data.dig('links', 'self') end |
#type ⇒ Object
9 10 11 |
# File 'lib/frilans_finans_api/resource.rb', line 9 def type @data['type'] end |