Class: Start::BaseResource

Inherits:
Object
  • Object
show all
Defined in:
lib/start/base_resource.rb

Direct Known Subclasses

Charge, Customer

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/start/base_resource.rb', line 4

def path
  @path
end

Class Method Details

.allObject



14
15
16
# File 'lib/start/base_resource.rb', line 14

def all
  handle_response Start.get(path)
end

.create(params = {}) ⇒ Object



6
7
8
# File 'lib/start/base_resource.rb', line 6

def create(params = {})
  handle_response Start.post(path, body: params)
end

.get(id) ⇒ Object



10
11
12
# File 'lib/start/base_resource.rb', line 10

def get(id)
  handle_response Start.post("#{path}/#{id}")
end