class Droutes::ClassStruct

Attributes

children[R]
controller[R]
docs[R]
name[R]
paths[R]

Public Class Methods

new(class_name, docs="") click to toggle source
# File lib/droutes/parser.rb, line 5
def initialize(class_name, docs="")
  @name = class_name
  if class_name
    controller = class_name.underscore
    @controller = controller[0, controller.length - "_controller".length]
  end
  @paths = ::Hash.new { |h, k| h[k] = {} }
  @children = []
  @docs = docs || ""
end

Public Instance Methods

add_to_path(struct) click to toggle source
# File lib/droutes/parser.rb, line 16
def add_to_path(struct)
  @paths[struct.path][struct.action] = struct
end