Class: JsonImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/turbine-core/importers/json_importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ JsonImporter

Returns a new instance of JsonImporter.



9
10
11
12
# File 'lib/turbine-core/importers/json_importer.rb', line 9

def initialize(type)
  @type = type
  @result = {}
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



7
8
9
# File 'lib/turbine-core/importers/json_importer.rb', line 7

def result
  @result
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/turbine-core/importers/json_importer.rb', line 7

def type
  @type
end

Instance Method Details

#import(json_text) ⇒ Object



14
15
16
# File 'lib/turbine-core/importers/json_importer.rb', line 14

def import(json_text)
  @result = JSON.parse(json_text)
end