Class: Velocity::Api::Base
- Inherits:
-
Object
- Object
- Velocity::Api::Base
- Includes:
- HTTParty
- Defined in:
- lib/velocity/api/base.rb
Defined Under Namespace
Classes: BadRequestError, InternalServerError, NotFoundError, UnauthorizedError
Constant Summary collapse
- PAGE_SIZE =
100
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
- #get(url) ⇒ Object
-
#initialize(args) ⇒ Base
constructor
A new instance of Base.
- #post(url, body) ⇒ Object
- #put(url, body) ⇒ Object
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
#args ⇒ Object
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, .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", .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, .merge(body))) end |