Class: ApplicationMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/api/application_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metricsObject

Returns the value of attribute metrics.



4
5
6
# File 'lib/api/application_message.rb', line 4

def metrics
  @metrics
end

#tsObject

Returns the value of attribute ts.



4
5
6
# File 'lib/api/application_message.rb', line 4

def ts
  @ts
end

#uidObject

Returns the value of attribute uid.



4
5
6
# File 'lib/api/application_message.rb', line 4

def uid
  @uid
end

Instance Method Details

#to_jsonObject



6
7
8
9
10
11
12
# File 'lib/api/application_message.rb', line 6

def to_json
  msg = Hash.new
  msg[:uid] = @uid
  msg[:metrics] = @metrics
  msg[:ts] = Time.now.strftime('%s')
  msg.to_json
end