Class: Croesus::RouteDSL
- Includes:
- DSLHelpers
- Defined in:
- lib/croesus/dsl/route_dsl.rb
Instance Method Summary collapse
-
#initialize(verb, path, &block) ⇒ RouteDSL
constructor
A new instance of RouteDSL.
- #to_hash ⇒ Object
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_hash ⇒ Object
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 |