Class: Relax::Event
- Inherits:
-
Object
- Object
- Relax::Event
- Defined in:
- lib/relax/event.rb
Constant Summary collapse
- ATTRIBUTES =
[:type, :user_uid, :channel_uid, :team_uid, :im, :text, :relax_bot_uid, :timestamp, :provider, :event_timestamp, :namespace]
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(opts = {}) ⇒ Event
constructor
A new instance of Event.
- #to_hash ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Event
Returns a new instance of Event.
9 10 11 |
# File 'lib/relax/event.rb', line 9 def initialize(opts = {}) opts.each { |k,v| self.send("#{k}=", v) if self.respond_to?("#{k}=") } end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
19 20 21 22 23 24 |
# File 'lib/relax/event.rb', line 19 def ==(other) other.respond_to?('channel_uid') && other.respond_to?('timestamp') && self.channel_uid == other.channel_uid && self. == other. end |
#to_hash ⇒ Object
13 14 15 16 17 |
# File 'lib/relax/event.rb', line 13 def to_hash hash = {} ATTRIBUTES.each { |a| hash[a] = self.send(a) } hash end |