Class: Velocity::Api::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/velocity/api/base.rb

Direct Known Subclasses

Invite, People, Role, Team

Defined Under Namespace

Classes: BadRequestError, InternalServerError, NotFoundError, UnauthorizedError

Constant Summary collapse

PAGE_SIZE =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Base

Returns a new instance of Base.



19
20
21
# File 'lib/velocity/api/base.rb', line 19

def initialize(args)
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



17
18
19
# File 'lib/velocity/api/base.rb', line 17

def args
  @args
end

Instance Method Details

#get(url) ⇒ Object



23
24
25
# File 'lib/velocity/api/base.rb', line 23

def get(url)
  parse_response(self.class.get(url, options.merge(query: build_query)))
end

#post(url, body) ⇒ Object



27
28
29
# File 'lib/velocity/api/base.rb', line 27

def post(url, body)
  parse_response(self.class.post("/invitations", options.merge(body)))
end

#put(url, body) ⇒ Object



31
32
33
# File 'lib/velocity/api/base.rb', line 31

def put(url, body)
  parse_response(self.class.put(url, options.merge(body)))
end