Class: LessNeglectApi::ActionEvent

Inherits:
Event show all
Defined in:
lib/lessneglect/objects/action_event.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#magnitude, #name

Instance Method Summary collapse

Methods inherited from ApiObject

#initialize

Constructor Details

This class inherits a constructor from LessNeglectApi::ApiObject

Instance Attribute Details

#external_identifierObject

Returns the value of attribute external_identifier.



4
5
6
# File 'lib/lessneglect/objects/action_event.rb', line 4

def external_identifier
  @external_identifier
end

#extrasObject

Returns the value of attribute extras.



4
5
6
# File 'lib/lessneglect/objects/action_event.rb', line 4

def extras
  @extras
end

Returns the value of attribute links.



4
5
6
# File 'lib/lessneglect/objects/action_event.rb', line 4

def links
  @links
end

#noteObject

Returns the value of attribute note.



4
5
6
# File 'lib/lessneglect/objects/action_event.rb', line 4

def note
  @note
end

Instance Method Details



6
7
8
9
# File 'lib/lessneglect/objects/action_event.rb', line 6

def add_link(name, href)
  self.links ||= []
  self.links << ActionLink.new({ :name => name, :href => href })
end

#as_json(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/lessneglect/objects/action_event.rb', line 11

def as_json(options={})
  super.merge({
    :klass => "actionevent",
    :note => self.note,
    :external_identifier => self.external_identifier,
    :extras => self.extras,
    :links => self.links.nil? ? nil : self.links.as_json
  }).as_json(options)
end