Class: Xaases::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/xaases/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(method, path) ⇒ Api

Returns a new instance of Api.



3
4
5
6
# File 'lib/xaases/api.rb', line 3

def initialize(method, path)
  @method = method.upcase
  @path = path
end

Instance Method Details

#nameObject



8
9
10
11
12
# File 'lib/xaases/api.rb', line 8

def name
  s = path.sub(/\A\//, '').sub(/\//, '_')
  s = 'root' if method == 'GET' && s == ''
  s
end