Class: Wikirate4ruby::Entities::Dataset

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

Constant Summary collapse

ATTRIBUTES =
%i[answers metrics companies license].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(dataset) ⇒ Dataset

Returns a new instance of Dataset.



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

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

  @answers = get_array_of 'items', Answer
  @metrics = get_content 'metrics'
  @companies = get_content 'companies'
  @license = get_content 'license'

end