Class: NPR::Entity::IntroText

Inherits:
Base
  • Object
show all
Defined in:
lib/npr/entity/intro_text.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) ⇒ IntroText

Returns a new instance of IntroText.



9
10
11
12
# File 'lib/npr/entity/intro_text.rb', line 9

def initialize(json)
  @num     = json["num"].to_i
  @content = json["$text"]
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#numObject

Returns the value of attribute num.



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

def num
  @num
end

Instance Method Details

#to_sObject




16
17
18
# File 'lib/npr/entity/intro_text.rb', line 16

def to_s
  @content.to_s
end