Class: Rails::Routes::Prettier::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/routes/prettier/formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter.



9
10
11
# File 'lib/rails/routes/prettier/formatter.rb', line 9

def initialize
  @routes = []
end

Instance Attribute Details

#routesObject (readonly)

Returns the value of attribute routes.



7
8
9
# File 'lib/rails/routes/prettier/formatter.rb', line 7

def routes
  @routes
end

Instance Method Details

#header(routes) ⇒ Object



15
# File 'lib/rails/routes/prettier/formatter.rb', line 15

def header(routes); end

#resultObject



17
18
19
# File 'lib/rails/routes/prettier/formatter.rb', line 17

def result
  routes
end

#section(routes) ⇒ Object



21
22
23
24
25
# File 'lib/rails/routes/prettier/formatter.rb', line 21

def section(routes)
  routes.map do |route|
    @routes << Rails::Routes::Prettier::Objects::Route.new(route)
  end
end

#section_title(title) ⇒ Object



13
# File 'lib/rails/routes/prettier/formatter.rb', line 13

def section_title(title); end