Class: Droutes::Struct

Inherits:
Object
  • Object
show all
Defined in:
lib/droutes/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, action, route, docs) ⇒ Struct

Returns a new instance of Struct.



24
25
26
27
28
29
30
# File 'lib/droutes/parser.rb', line 24

def initialize(klass, action, route, docs)
  @klass = klass
  @action = action
  @verb = route.verb
  @path = route.path.sub(/\(.:format\)/, "")
  @docs = docs
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



22
23
24
# File 'lib/droutes/parser.rb', line 22

def action
  @action
end

#docsObject (readonly)

Returns the value of attribute docs.



22
23
24
# File 'lib/droutes/parser.rb', line 22

def docs
  @docs
end

#klassObject (readonly)

Returns the value of attribute klass.



22
23
24
# File 'lib/droutes/parser.rb', line 22

def klass
  @klass
end

#pathObject (readonly)

Returns the value of attribute path.



22
23
24
# File 'lib/droutes/parser.rb', line 22

def path
  @path
end

#verbObject (readonly)

Returns the value of attribute verb.



22
23
24
# File 'lib/droutes/parser.rb', line 22

def verb
  @verb
end

Instance Method Details

#controllerObject



32
33
34
# File 'lib/droutes/parser.rb', line 32

def controller
  @klass.controller
end