Class: Mycommands::View
- Inherits:
-
Object
show all
- Defined in:
- lib/mycommands/views/view.rb
Instance Method Summary
collapse
Constructor Details
#initialize(printer = Factory::get(:Printer)) ⇒ View
Returns a new instance of View.
40
41
42
43
|
# File 'lib/mycommands/views/view.rb', line 40
def initialize printer = Factory::get(:Printer)
@router = Factory::get(:Router)
@printer = printer
end
|
Instance Method Details
#add_default_routes ⇒ Object
53
54
55
|
# File 'lib/mycommands/views/view.rb', line 53
def add_default_routes
@router.add_route(:match => '0', :controller => "Category", :action => "index", :input => '0')
end
|
49
50
51
|
# File 'lib/mycommands/views/view.rb', line 49
def text
print "\n "+"#{text}".underline
end
|
#print(string) ⇒ Object
45
46
47
|
# File 'lib/mycommands/views/view.rb', line 45
def print string
@printer.print string
end
|