Class: Ledger::Event
- Inherits:
-
Object
- Object
- Ledger::Event
- Defined in:
- lib/ledger/event.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#object ⇒ Object
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(opts) ⇒ Event
Returns a new instance of Event.
5 6 7 8 9 |
# File 'lib/ledger/event.rb', line 5 def initialize opts opts.each do |attr, value| self.send("#{attr}=", value) if respond_to?("#{attr}=") end end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/ledger/event.rb', line 3 def action @action end |
#actor ⇒ Object
Returns the value of attribute actor.
3 4 5 |
# File 'lib/ledger/event.rb', line 3 def actor @actor end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/ledger/event.rb', line 3 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/ledger/event.rb', line 3 def data @data end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/ledger/event.rb', line 3 def object @object end |
Class Method Details
.from_json(json) ⇒ Object
12 13 14 15 |
# File 'lib/ledger/event.rb', line 12 def from_json json require 'json' self.new JSON.parse json end |