Class: Liberty::Router::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/liberty/router/printer.rb

Constant Summary collapse

VERBS =
%w[GET HEAD POST PUT PATCH DELETE].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dynamicObject (readonly)

Returns the value of attribute dynamic.



8
9
10
# File 'lib/liberty/router/printer.rb', line 8

def dynamic
  @dynamic
end

#memoObject (readonly)

Returns the value of attribute memo.



8
9
10
# File 'lib/liberty/router/printer.rb', line 8

def memo
  @memo
end

#staticObject (readonly)

Returns the value of attribute static.



8
9
10
# File 'lib/liberty/router/printer.rb', line 8

def static
  @static
end

#stdoutObject (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



16
17
18
19
20
# File 'lib/liberty/router/printer.rb', line 16

def print
  gather_static_routes
  gather_dynamic_routes
  print_routes
end