Class: Bacchus::Backend
- Inherits:
-
Object
- Object
- Bacchus::Backend
- Defined in:
- lib/bacchus/backend.rb
Instance Method Summary collapse
-
#initialize(base_url) ⇒ Backend
constructor
A new instance of Backend.
- #locked?(access_pass) ⇒ Boolean
- #path_to(resource) ⇒ Object
Constructor Details
#initialize(base_url) ⇒ Backend
Returns a new instance of Backend.
5 6 7 |
# File 'lib/bacchus/backend.rb', line 5 def initialize(base_url) @base_url = base_url end |
Instance Method Details
#locked?(access_pass) ⇒ Boolean
9 10 11 12 13 |
# File 'lib/bacchus/backend.rb', line 9 def locked?(access_pass) RestClient.get(path_to("/api/1/access/#{access_pass.to_s}")) do |response, _| return response.code != 200 end end |
#path_to(resource) ⇒ Object
15 16 17 |
# File 'lib/bacchus/backend.rb', line 15 def path_to(resource) File.join(@base_url, resource) end |