Class: RemoteFactoryGirl::FactoryGirlJsonParser

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_factory_girl/factory_girl_json_parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_hashObject (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_rootObject



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