Class: WCC::Media::Base
- Inherits:
-
Object
- Object
- WCC::Media::Base
- Includes:
- ActiveRecordShim, Cacheable
- Defined in:
- lib/wcc/media/base.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #_links ⇒ Object
- #id ⇒ Object
-
#initialize(raw, headers = {}) ⇒ Base
constructor
A new instance of Base.
- #legacy_id ⇒ Object
Methods included from ActiveRecordShim
Methods included from Cacheable
Constructor Details
#initialize(raw, headers = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/wcc/media/base.rb', line 12 def initialize(raw, headers = {}) @raw = raw @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/wcc/media/base.rb', line 10 def headers @headers end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
10 11 12 |
# File 'lib/wcc/media/base.rb', line 10 def raw @raw end |
Instance Method Details
#_links ⇒ Object
25 26 27 |
# File 'lib/wcc/media/base.rb', line 25 def _links OpenStruct.new(raw['_links']) if raw['_links'] end |
#id ⇒ Object
17 18 19 |
# File 'lib/wcc/media/base.rb', line 17 def id raw['id']&.to_s end |
#legacy_id ⇒ Object
21 22 23 |
# File 'lib/wcc/media/base.rb', line 21 def legacy_id raw['legacy_id']&.to_s end |