Class: JsonImporter
- Inherits:
-
Object
- Object
- JsonImporter
- Defined in:
- lib/turbine-core/importers/json_importer.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #import(json_text) ⇒ Object
-
#initialize(type) ⇒ JsonImporter
constructor
A new instance of JsonImporter.
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
#result ⇒ Object
Returns the value of attribute result.
7 8 9 |
# File 'lib/turbine-core/importers/json_importer.rb', line 7 def result @result end |
#type ⇒ Object
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 |