Class: ViewServer::Server
- Inherits:
-
Object
- Object
- ViewServer::Server
- Defined in:
- lib/view_server/server.rb
Instance Attribute Summary collapse
-
#launcher ⇒ Object
readonly
Returns the value of attribute launcher.
Class Method Summary collapse
Instance Method Summary collapse
- #copy(str) ⇒ Object
-
#initialize(launcher = Launcher.new) ⇒ Server
constructor
A new instance of Server.
- #paste ⇒ Object
-
#show(data, file_ext = 'txt') ⇒ Object
I wanted to use the display method but it conflicts with the Object#display method.
Constructor Details
#initialize(launcher = Launcher.new) ⇒ Server
Returns a new instance of Server.
9 10 11 12 |
# File 'lib/view_server/server.rb', line 9 def initialize(launcher = Launcher.new) @launcher = launcher @clipboard = MyClipboard end |
Instance Attribute Details
#launcher ⇒ Object (readonly)
Returns the value of attribute launcher.
7 8 9 |
# File 'lib/view_server/server.rb', line 7 def launcher @launcher end |
Class Method Details
Instance Method Details
#copy(str) ⇒ Object
20 21 22 |
# File 'lib/view_server/server.rb', line 20 def copy(str) @clipboard.copy(str) end |
#paste ⇒ Object
24 25 26 |
# File 'lib/view_server/server.rb', line 24 def paste @clipboard.paste end |
#show(data, file_ext = 'txt') ⇒ Object
I wanted to use the display method but it conflicts with the Object#display method
16 17 18 |
# File 'lib/view_server/server.rb', line 16 def show(data, file_ext = 'txt') launcher.launch(data, file_ext) end |