Class: Dao::Endpoint

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

Constant Summary collapse

Attrs =
%w( api path route block doc )

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Endpoint

Returns a new instance of Endpoint.



6
7
8
# File 'lib/dao/endpoint.rb', line 6

def initialize(options = {})
  update(options)
end

Instance Method Details

#arityObject



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

def arity
  block.arity
end

#call(*args) ⇒ Object



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

def call(*args)
  block.call(*args)
end

#to_procObject



24
25
26
# File 'lib/dao/endpoint.rb', line 24

def to_proc
  block
end

#update(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/dao/endpoint.rb', line 10

def update(options = {})
  options.each do |key, val|
    send("#{ key }=", val)
  end
end