Class: NPR::Entity::Paragraph

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




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

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



11
12
13
# File 'lib/npr/entity/paragraph.rb', line 11

def content
  @content
end

#numObject

Returns the value of attribute num.



11
12
13
# File 'lib/npr/entity/paragraph.rb', line 11

def num
  @num
end

Instance Method Details

#to_sObject




22
23
24
# File 'lib/npr/entity/paragraph.rb', line 22

def to_s
  @content.to_s
end