Class: Pcloud::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/pcloud/resource.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, path = "") ⇒ Resource

Returns a new instance of Resource.



6
7
8
# File 'lib/pcloud/resource.rb', line 6

def initialize(client, path = "")
  @client, @path = client, path
end

Instance Method Details

#fileObject



18
19
20
# File 'lib/pcloud/resource.rb', line 18

def file
  @file ||= FileHandler.new(@client)
end

#get(params) ⇒ Object



10
11
12
# File 'lib/pcloud/resource.rb', line 10

def get(params)
  create_request(:get, params).call
end

#post(params, payload = {}) ⇒ Object



14
15
16
# File 'lib/pcloud/resource.rb', line 14

def post(params, payload = {})
  create_request(:post, params, payload).call
end