Class: WCC::Media::Base
- Inherits:
-
Object
- Object
- WCC::Media::Base
- Includes:
- ActiveRecordShim, Cacheable
- Defined in:
- lib/wcc/media/base.rb
Direct Known Subclasses
LiveStream, LiveStream::Event, Message, Playlist, Series, Speaker, Tag
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
#cache_key, hash_cache_key, #last_modified
Constructor Details
#initialize(raw, headers = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 17 |
# File 'lib/wcc/media/base.rb', line 14 def initialize(raw, headers = {}) @raw = raw @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
12 13 14 |
# File 'lib/wcc/media/base.rb', line 12 def headers @headers end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'lib/wcc/media/base.rb', line 12 def raw @raw end |
Instance Method Details
#_links ⇒ Object
27 28 29 |
# File 'lib/wcc/media/base.rb', line 27 def _links OpenStruct.new(raw['_links']) if raw['_links'] end |
#id ⇒ Object
19 20 21 |
# File 'lib/wcc/media/base.rb', line 19 def id raw['id']&.to_s end |
#legacy_id ⇒ Object
23 24 25 |
# File 'lib/wcc/media/base.rb', line 23 def legacy_id raw['legacy_id']&.to_s end |