Class: Rails::Routes::Prettier::Formatter
- Inherits:
-
Object
- Object
- Rails::Routes::Prettier::Formatter
- Defined in:
- lib/rails/routes/prettier/formatter.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
Instance Method Summary collapse
- #header(routes) ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
- #result ⇒ Object
- #section(routes) ⇒ Object
- #section_title(title) ⇒ Object
Constructor Details
#initialize ⇒ Formatter
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
#routes ⇒ Object (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 |
#result ⇒ Object
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 |