Class: Liberty::Router::Printer
- Inherits:
-
Object
- Object
- Liberty::Router::Printer
- Defined in:
- lib/liberty/router/printer.rb
Constant Summary collapse
- VERBS =
%w[GET HEAD POST PUT PATCH DELETE].freeze
Instance Attribute Summary collapse
-
#dynamic ⇒ Object
readonly
Returns the value of attribute dynamic.
-
#memo ⇒ Object
readonly
Returns the value of attribute memo.
-
#static ⇒ Object
readonly
Returns the value of attribute static.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(static, dynamic, stdout = $stdout) ⇒ Printer
constructor
A new instance of Printer.
- #print ⇒ Object
Constructor Details
#initialize(static, dynamic, stdout = $stdout) ⇒ Printer
Returns a new instance of Printer.
10 11 12 13 14 |
# File 'lib/liberty/router/printer.rb', line 10 def initialize(static, dynamic, stdout = $stdout) @static, @dynamic = static, dynamic @stdout = stdout @memo = [] end |
Instance Attribute Details
#dynamic ⇒ Object (readonly)
Returns the value of attribute dynamic.
8 9 10 |
# File 'lib/liberty/router/printer.rb', line 8 def dynamic @dynamic end |
#memo ⇒ Object (readonly)
Returns the value of attribute memo.
8 9 10 |
# File 'lib/liberty/router/printer.rb', line 8 def memo @memo end |
#static ⇒ Object (readonly)
Returns the value of attribute static.
8 9 10 |
# File 'lib/liberty/router/printer.rb', line 8 def static @static end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
8 9 10 |
# File 'lib/liberty/router/printer.rb', line 8 def stdout @stdout end |
Instance Method Details
#print ⇒ Object
16 17 18 19 20 |
# File 'lib/liberty/router/printer.rb', line 16 def print gather_static_routes gather_dynamic_routes print_routes end |