Class: Hdo::StortingImporter::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/hdo/storting_importer/converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_source) ⇒ Converter

Returns a new instance of Converter.



5
6
7
8
# File 'lib/hdo/storting_importer/converter.rb', line 5

def initialize(data_source)
  @data_source = data_source
  @cache = {}
end

Instance Method Details

#json_for(name, opts = nil) ⇒ Object



10
11
12
13
14
# File 'lib/hdo/storting_importer/converter.rb', line 10

def json_for(name, opts = nil)
  obj = data_for(name)
  
  Yajl::Encoder.encode(obj, opts && opts[:pretty])
end