Class: RestforceMock::Client::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/restforce_mock/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, type = nil) ⇒ Body

Returns a new instance of Body.



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/restforce_mock/client.rb', line 99

def initialize(id, type= nil)
  collection = {"totalSize"=>1, "done"=>true,
                "records"=>[{"attributes"=>{"type"=>"Contact", "url"=>""}, "Id"=> id}]}

  @body =

    if type == 'query'
     Restforce::Collection.new(collection, Restforce::Data::Client.new)
    else
      {'id' => id}
    end
end

Instance Method Details

#bodyObject



112
113
114
# File 'lib/restforce_mock/client.rb', line 112

def body
  @body
end