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

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_remote_execution_ssh/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.



33
34
35
36
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 33

def initialize(data, timestamp = Time.now)
  @data = data
  @timestamp = timestamp
end

Instance Attribute Details

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

#timestampObject (readonly)

Returns the value of attribute timestamp.



31
32
33
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 31

def timestamp
  @timestamp
end

Instance Method Details

#data_typeObject

Raises:

  • (NotImplemented)


38
39
40
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 38

def data_type
  raise NotImplemented
end

#to_hashObject



42
43
44
45
46
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 42

def to_hash
  { :output_type => data_type,
    :output => data,
    :timestamp => timestamp.to_f }
end