Class: Bacchus::Backend

Inherits:
Object
  • Object
show all
Defined in:
lib/bacchus/backend.rb

Instance Method Summary collapse

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

Returns:

  • (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