Class: Awt::Printer
- Inherits:
-
Object
- Object
- Awt::Printer
- Defined in:
- lib/awt/printer.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(host) ⇒ Printer
constructor
A new instance of Printer.
- #method_missing(action, *args) ⇒ Object
Constructor Details
#initialize(host) ⇒ Printer
Returns a new instance of Printer.
5 6 7 |
# File 'lib/awt/printer.rb', line 5 def initialize(host) @host = host end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(action, *args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/awt/printer.rb', line 9 def method_missing(action, *args) if action.to_s =~ /print_(.+)/ puts "[#{@host}] #{$1}: #{args.first}" else super end end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/awt/printer.rb', line 3 def host @host end |