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
37
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 33

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.



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)


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

def data_type
  raise NotImplemented
end

#to_hashObject



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