Class: NPR::Entity::Program
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#content ⇒ Object
Returns the value of attribute content.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(json) ⇒ Program
constructor
——————-.
-
#title ⇒ Object
(also: #to_s)
——————-.
Methods included from Concern::ShallowAttributes
Methods included from Concern::Relation
Constructor Details
#initialize(json) ⇒ Program
11 12 13 14 15 |
# File 'lib/npr/entity/program.rb', line 11 def initialize(json) @id = json["id"].to_i @content = json["$text"] @code = json["code"] end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
7 8 9 |
# File 'lib/npr/entity/program.rb', line 7 def code @code end |
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/npr/entity/program.rb', line 7 def content @content end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/npr/entity/program.rb', line 7 def id @id end |
Instance Method Details
#title ⇒ Object Also known as: to_s
19 20 21 |
# File 'lib/npr/entity/program.rb', line 19 def title @content.to_s end |