Class: Proxy::RemoteExecution::Ssh::CommandUpdate::Data
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::CommandUpdate::Data
- Defined in:
- lib/smart_proxy_remote_execution_ssh_core/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.
35 36 37 38 39 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 35 def initialize(data, = Time.now) @data = data @data = @data.force_encoding('UTF-8') if @data.is_a? String @timestamp = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
33 34 35 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 33 def data @data end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
33 34 35 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 33 def @timestamp end |
Instance Method Details
#data_type ⇒ Object
41 42 43 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 41 def data_type raise NotImplemented end |
#to_hash ⇒ Object
45 46 47 48 49 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 45 def to_hash { :output_type => data_type, :output => data, :timestamp => .to_f } end |