Class: RemoteFactoryGirl::FactoryGirlJsonParser
- Inherits:
-
Object
- Object
- RemoteFactoryGirl::FactoryGirlJsonParser
- Defined in:
- lib/remote_factory_girl/factory_girl_json_parser.rb
Instance Attribute Summary collapse
-
#response_hash ⇒ Object
readonly
Returns the value of attribute response_hash.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ FactoryGirlJsonParser
constructor
A new instance of FactoryGirlJsonParser.
- #without_root ⇒ Object
Constructor Details
#initialize(response_hash) ⇒ FactoryGirlJsonParser
Returns a new instance of FactoryGirlJsonParser.
10 11 12 |
# File 'lib/remote_factory_girl/factory_girl_json_parser.rb', line 10 def initialize(response_hash) @response_hash = response_hash end |
Instance Attribute Details
#response_hash ⇒ Object (readonly)
Returns the value of attribute response_hash.
8 9 10 |
# File 'lib/remote_factory_girl/factory_girl_json_parser.rb', line 8 def response_hash @response_hash end |
Class Method Details
.without_root(response_hash) ⇒ Object
4 5 6 |
# File 'lib/remote_factory_girl/factory_girl_json_parser.rb', line 4 def self.without_root(response_hash) new(response_hash).without_root end |
Instance Method Details
#without_root ⇒ Object
14 15 16 |
# File 'lib/remote_factory_girl/factory_girl_json_parser.rb', line 14 def without_root has_root_key? ? response_array.last : response_hash end |