Class: NPR::Entity::Link

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




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

def initialize(json)
  @content = json["$text"]
  @type    = json["type"]
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_sObject




18
19
20
# File 'lib/npr/entity/link.rb', line 18

def to_s
  @content.to_s
end