Class: NPR::Entity::RelatedLink

Inherits:
Base
  • Object
show all
Includes:
Concern::LinksAssociation
Defined in:
lib/npr/entity/related_link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concern::LinksAssociation

included, #link_for

Methods included from Concern::ShallowAttributes

included

Methods included from Concern::Relation

included

Constructor Details

#initialize(json) ⇒ RelatedLink

Returns a new instance of RelatedLink.



12
13
14
15
16
17
18
# File 'lib/npr/entity/related_link.rb', line 12

def initialize(json)
  extract_shallow_attributes(json)
  create_relations(json)

  @id   = json["id"].to_i
  @type = json["type"]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end