Class: Proxy::RemoteExecution::Ssh::CommandUpdate::Data
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::CommandUpdate::Data
- Defined in:
- lib/smart_proxy_remote_execution_ssh/command_update.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #data_type ⇒ Object
-
#initialize(data, timestamp = Time.now) ⇒ Data
constructor
A new instance of Data.
- #to_hash ⇒ Object
Constructor Details
#initialize(data, timestamp = Time.now) ⇒ Data
Returns a new instance of Data.
33 34 35 36 37 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 33 def initialize(data, = Time.now) @data = data @data = @data.force_encoding('UTF-8') if @data.is_a? String = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
31 32 33 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 31 def data @data end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
31 32 33 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 31 def end |
Instance Method Details
#data_type ⇒ Object
39 40 41 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 39 def data_type raise NotImplemented end |
#to_hash ⇒ Object
43 44 45 46 47 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 43 def to_hash { :output_type => data_type, :output => data, :timestamp => .to_f } end |