Class: Wikirate4ruby::Entities::Topic

Inherits:
Card
  • Object
show all
Defined in:
lib/wikirate4ruby/entities/topic.rb

Constant Summary collapse

ATTRIBUTES =
%i[bookmarkers metrics datasets].freeze

Constants inherited from Card

Card::CARD_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Card

#as_json, #raw_json, #to_json, #to_s

Constructor Details

#initialize(topic) ⇒ Topic

Returns a new instance of Topic.



9
10
11
12
13
14
15
16
17
# File 'lib/wikirate4ruby/entities/topic.rb', line 9

def initialize(topic)
  super topic
  raise parsing_error name = "IncompatibleCardType", message = "The input Card is not a Topic but a #{@type}" if @type != 'Topic'

  @bookmarkers = get_content 'bookmarkers'
  @metrics = get_content 'metrics'
  @datasets = get_content 'datasets'

end