Class: Scale::Endpoints::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/scale/endpoints/endpoint.rb

Direct Known Subclasses

Tasks::TaskEndpoint

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api, *args) ⇒ Endpoint

Returns a new instance of Endpoint.



6
7
8
9
10
# File 'lib/scale/endpoints/endpoint.rb', line 6

def initialize(api, *args)
  @api = api
  @args = args
  @params = Scale.hash(args.pop) if args.last.is_a?(Hash)
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



4
5
6
# File 'lib/scale/endpoints/endpoint.rb', line 4

def api
  @api
end

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/scale/endpoints/endpoint.rb', line 4

def args
  @args
end

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/scale/endpoints/endpoint.rb', line 4

def params
  @params
end

Class Method Details

.match?(method) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/scale/endpoints/endpoint.rb', line 20

def self.match?(method)
  shortcut.to_s == method.to_s
end

.shortcutObject



16
17
18
# File 'lib/scale/endpoints/endpoint.rb', line 16

def self.shortcut
  nil
end

Instance Method Details

#processObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/scale/endpoints/endpoint.rb', line 12

def process
  raise NotImplementedError
end