Class: NPR::Entity::Program

Inherits:
Base
  • Object
show all
Defined in:
lib/npr/entity/program.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concern::ShallowAttributes

included

Methods included from Concern::Relation

included

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

#codeObject

Returns the value of attribute code.



7
8
9
# File 'lib/npr/entity/program.rb', line 7

def code
  @code
end

#contentObject

Returns the value of attribute content.



7
8
9
# File 'lib/npr/entity/program.rb', line 7

def content
  @content
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/npr/entity/program.rb', line 7

def id
  @id
end

Instance Method Details

#titleObject Also known as: to_s




19
20
21
# File 'lib/npr/entity/program.rb', line 19

def title
  @content.to_s
end