Class: EventsManager::Event
- Inherits:
-
Object
- Object
- EventsManager::Event
- Defined in:
- lib/events_manager/event.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
Instance Method Summary collapse
-
#initialize(entity, action, data) ⇒ Event
constructor
A new instance of Event.
- #issue_create? ⇒ Boolean
- #issue_relation_create? ⇒ Boolean
- #issue_update? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(entity, action, data) ⇒ Event
Returns a new instance of Event.
7 8 9 10 11 |
# File 'lib/events_manager/event.rb', line 7 def initialize(entity, action, data) @entity = entity @action = action @data = data end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/events_manager/event.rb', line 5 def action @action end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/events_manager/event.rb', line 5 def data @data end |
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
5 6 7 |
# File 'lib/events_manager/event.rb', line 5 def entity @entity end |
Instance Method Details
#issue_create? ⇒ Boolean
17 18 19 |
# File 'lib/events_manager/event.rb', line 17 def issue_create? entity == ::Issue && action == :create end |
#issue_relation_create? ⇒ Boolean
25 26 27 |
# File 'lib/events_manager/event.rb', line 25 def issue_relation_create? entity == ::IssueRelation && action == :create end |
#issue_update? ⇒ Boolean
21 22 23 |
# File 'lib/events_manager/event.rb', line 21 def issue_update? entity == ::Issue && action == :update end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/events_manager/event.rb', line 13 def to_s "#{entity}::#{action}|#{data.class}(#{data.id})" end |