Class: MashapeAnalytics::Message::Alf
- Inherits:
-
Object
- Object
- MashapeAnalytics::Message::Alf
- Defined in:
- lib/mashape-analytics/message/alf.rb
Instance Attribute Summary collapse
-
#test ⇒ Object
Returns the value of attribute test.
Instance Method Summary collapse
- #add_entry(entry) ⇒ Object
-
#initialize(serviceToken, environment, clientIp = nil) ⇒ Alf
constructor
A new instance of Alf.
- #to_s ⇒ Object
Constructor Details
#initialize(serviceToken, environment, clientIp = nil) ⇒ Alf
Returns a new instance of Alf.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mashape-analytics/message/alf.rb', line 7 def initialize(serviceToken, environment, clientIp = nil) @entries = [] @alf = { version: '1.0.0', serviceToken: serviceToken, environment: environment, har: { log: { version: '1.2', creator: { name: 'mashape-analytics-agent-ruby', version: '1.0.0' }, entries: @entries } } } if clientIp @alf.clientIpAddress = clientIp end end |
Instance Attribute Details
#test ⇒ Object
Returns the value of attribute test.
5 6 7 |
# File 'lib/mashape-analytics/message/alf.rb', line 5 def test @test end |
Instance Method Details
#add_entry(entry) ⇒ Object
30 31 32 |
# File 'lib/mashape-analytics/message/alf.rb', line 30 def add_entry(entry) @entries << entry end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/mashape-analytics/message/alf.rb', line 34 def to_s @alf.to_json end |