diff --git a/lib/sharp-coin/interface/telnet.rb b/lib/sharp-coin/interface/telnet.rb index db89468..487f2d1 100644 --- a/lib/sharp-coin/interface/telnet.rb +++ b/lib/sharp-coin/interface/telnet.rb @@ -3,11 +3,22 @@ require 'em/protocols/line_and_text' module SharpCoin module Interface - # Telnet API for SharpCoin. Used for debugging and administrative tasks + # Telnet API for SharpCoin. Used for debugging and administrative tasks. + # Currently very basic. Will probably never be cleaned up much - aim is + # to be able to remove it by making all functions accessible via REST API. # # @author Nick Thomas class Telnet < EM::P::LineAndTextProtocol - + def receive_line(line) + send_data(eval(line)) + end + + def puts(data) + send_data(data + "\n") + end + def print(data) + send_data(data) + end end end