Class: NPR::Entity::Audio
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#stream ⇒ Object
Returns the value of attribute stream.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(json) ⇒ Audio
constructor
——————-
streamreturns true if “active” is set to “true”.
Methods included from Concern::ShallowAttributes
Methods included from Concern::Relation
Constructor Details
#initialize(json) ⇒ Audio
stream returns true if “active” is set to “true”
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/npr/entity/audio.rb', line 14 def initialize(json) @id = json["id"].to_i @type = json["type"] if json["stream"] @stream = json["stream"]["active"] == "true" end create_relations(json) extract_shallow_attributes(json) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/npr/entity/audio.rb', line 7 def id @id end |
#stream ⇒ Object
Returns the value of attribute stream.
7 8 9 |
# File 'lib/npr/entity/audio.rb', line 7 def stream @stream end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/npr/entity/audio.rb', line 7 def type @type end |