Class: Croesus::RouteDSL

Inherits:
Object show all
Includes:
DSLHelpers
Defined in:
lib/croesus/dsl/route_dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(verb, path, &block) ⇒ RouteDSL

Returns a new instance of RouteDSL.



27
28
29
30
31
32
33
34
35
# File 'lib/croesus/dsl/route_dsl.rb', line 27

def initialize(verb, path, &block)
  instance_eval(&block)
  @name        ||= name
  @verb          = verb
  @path          = path
  @input       ||= nil
  @returns     ||= nil
  @description ||= description
end

Instance Method Details

#to_hashObject



37
38
39
40
# File 'lib/croesus/dsl/route_dsl.rb', line 37

def to_hash
  { name: @name, verb: @verb, path: @path, input: @input,
    returns: @returns, description: @description }
end