Class: Goz::Event
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- Goz::Event
- Defined in:
- lib/goz/event.rb
Overview
Class Method Summary collapse
- .admin_add(group, user) ⇒ Object
- .admin_remove(group, user) ⇒ Object
- .group_add(group) ⇒ Object
- .group_remove(group) ⇒ Object
- .group_service_add(group, service) ⇒ Object
- .group_service_remove(group, service) ⇒ Object
- .group_service_sync(group, service) ⇒ Object
- .group_sync(group) ⇒ Object
- .member_add(group, user) ⇒ Object
- .member_remove(group, user) ⇒ Object
- .service_add(service) ⇒ Object
- .service_remove(service) ⇒ Object
- .service_sync(service) ⇒ Object
- .user_add(user) ⇒ Object
- .user_remove(user) ⇒ Object
- .user_sync(user) ⇒ Object
Instance Method Summary collapse
-
#initialize(*params) {|_self| ... } ⇒ Event
constructor
Initialize new (non-persistent) Goz::Event object.
-
#validate ⇒ Object
Perform model valiations.
Constructor Details
#initialize(*params) {|_self| ... } ⇒ Event
Initialize new (non-persistent) Goz::Event object
33 34 35 36 37 |
# File 'lib/goz/event.rb', line 33 def initialize(*params) super yield self if block_given? self end |
Class Method Details
.admin_add(group, user) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/goz/event.rb', line 39 def self.admin_add(group, user) self.create :event_type => Goz::EventType::ADMIN_ADD, :group => group, :group_id => group.id, :user => user, :user_id => user.id end |
.admin_remove(group, user) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/goz/event.rb', line 47 def self.admin_remove(group, user) self.create :event_type => Goz::EventType::ADMIN_REMOVE, :group => group, :group_id => group.id, :user => user, :user_id => user.id end |
.group_add(group) ⇒ Object
55 56 57 58 59 |
# File 'lib/goz/event.rb', line 55 def self.group_add(group) self.create :event_type => Goz::EventType::GROUP_ADD, :group => group, :group_id => group.id end |
.group_remove(group) ⇒ Object
61 62 63 64 65 |
# File 'lib/goz/event.rb', line 61 def self.group_remove(group) self.create :event_type => Goz::EventType::GROUP_REMOVE, :group => group, :group_id => group.id end |
.group_service_add(group, service) ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/goz/event.rb', line 73 def self.group_service_add(group, service) self.create :event_type => Goz::EventType::GROUP_SERVICE_ADD, :group => group, :group_id => group.id, :service => service, :service_id => service.id end |
.group_service_remove(group, service) ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/goz/event.rb', line 81 def self.group_service_remove(group, service) self.create :event_type => Goz::EventType::GROUP_SERVICE_REMOVE, :group => group, :group_id => group.id, :service => service, :service_id => service.id end |
.group_service_sync(group, service) ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/goz/event.rb', line 89 def self.group_service_sync(group, service) self.create :event_type => Goz::EventType::GROUP_SERVICE_SYNC, :group => group, :group_id => group.id, :service => service, :service_id => service.id end |
.group_sync(group) ⇒ Object
67 68 69 70 71 |
# File 'lib/goz/event.rb', line 67 def self.group_sync(group) self.create :event_type => Goz::EventType::GROUP_SYNC, :group => group, :group_id => group.id end |
.member_add(group, user) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/goz/event.rb', line 97 def self.member_add(group, user) self.create :event_type => Goz::EventType::MEMBER_ADD, :group => group, :group_id => group.id, :user => user, :user_id => user.id end |
.member_remove(group, user) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/goz/event.rb', line 105 def self.member_remove(group, user) self.create :event_type => Goz::EventType::MEMBER_REMOVE, :group => group, :group_id => group.id, :user => user, :user_id => user.id end |
.service_add(service) ⇒ Object
113 114 115 116 117 |
# File 'lib/goz/event.rb', line 113 def self.service_add(service) self.create :event_type => Goz::EventType::SERVICE_ADD, :service => service, :service_id => service.id end |
.service_remove(service) ⇒ Object
119 120 121 122 123 |
# File 'lib/goz/event.rb', line 119 def self.service_remove(service) self.create :event_type => Goz::EventType::SERVICE_REMOVE, :service => service, :service_id => service.id end |
.service_sync(service) ⇒ Object
125 126 127 128 129 |
# File 'lib/goz/event.rb', line 125 def self.service_sync(service) self.create :event_type => Goz::EventType::SERVICE_SYNC, :service => service, :service_id => service.id end |
.user_add(user) ⇒ Object
131 132 133 134 135 |
# File 'lib/goz/event.rb', line 131 def self.user_add(user) self.create :event_type => Goz::EventType::USER_ADD, :user => user, :user_id => user.id end |