Class: Proxy::RemoteExecution::Ssh::CommandUpdate::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_remote_execution_ssh_core/command_update.rb

Direct Known Subclasses

DebugData, StatusData, StderrData, StdoutData

Instance Attribute Summary collapse

Instance Method Summary collapse

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, timestamp = Time.now)
  @data = data
  @data = @data.force_encoding('UTF-8') if @data.is_a? String
  @timestamp = timestamp
end

Instance Attribute Details

#dataObject (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

#timestampObject (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
  @timestamp
end

Instance Method Details

#data_typeObject

Raises:

  • (NotImplemented)


41
42
43
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 41

def data_type
  raise NotImplemented
end

#to_hashObject



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 => timestamp.to_f }
end