Class: Preact::Event
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#external_identifier ⇒ Object
Returns the value of attribute external_identifier.
-
#extras ⇒ Object
Returns the value of attribute extras.
-
#link_url ⇒ Object
Returns the value of attribute link_url.
-
#links ⇒ Object
Returns the value of attribute links.
-
#name ⇒ Object
Returns the value of attribute name.
-
#note ⇒ Object
Returns the value of attribute note.
-
#revenue ⇒ Object
Returns the value of attribute revenue.
-
#target_id ⇒ Object
Returns the value of attribute target_id.
-
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
Methods inherited from ApiObject
Constructor Details
This class inherits a constructor from Preact::ApiObject
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
3 4 5 |
# File 'lib/preact/objects/event.rb', line 3 def account @account end |
#external_identifier ⇒ Object
Returns the value of attribute external_identifier.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def external_identifier @external_identifier end |
#extras ⇒ Object
Returns the value of attribute extras.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def extras @extras end |
#link_url ⇒ Object
Returns the value of attribute link_url.
6 7 8 |
# File 'lib/preact/objects/event.rb', line 6 def link_url @link_url end |
#links ⇒ Object
Returns the value of attribute links.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def links @links end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/preact/objects/event.rb', line 3 def name @name end |
#note ⇒ Object
Returns the value of attribute note.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def note @note end |
#revenue ⇒ Object
Returns the value of attribute revenue.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def revenue @revenue end |
#target_id ⇒ Object
Returns the value of attribute target_id.
5 6 7 |
# File 'lib/preact/objects/event.rb', line 5 def target_id @target_id end |
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
6 7 8 |
# File 'lib/preact/objects/event.rb', line 6 def thumb_url @thumb_url end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/preact/objects/event.rb', line 3 def @timestamp end |
Instance Method Details
#add_link(name, href) ⇒ Object
8 9 10 11 |
# File 'lib/preact/objects/event.rb', line 8 def add_link(name, href) self.links ||= [] self.links << ActionLink.new({ :name => name, :href => href }) end |
#as_json(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/preact/objects/event.rb', line 13 def as_json(={}) { :klass => "actionevent", :name => self.name, :timestamp => self., :account => self.account, :revenue => self.revenue, :source => Preact.configuration.user_agent, # version of this logging library :note => self.note, :external_identifier => self.target_id || self.external_identifier, :extras => self.extras, :links => self.links.nil? ? nil : self.links.as_json, :thumb_url => self.thumb_url, :link_url => self.link_url } end |