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.



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

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

Instance Method Details

#arityObject



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

def arity
  block.arity
end

#call(*args) ⇒ Object



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

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

#to_procObject



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

def to_proc
  block
end

#update(options = {}) ⇒ Object



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

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