Class: Slack::Message
Defined Under Namespace
Classes: Request
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Message
constructor
A new instance of Message.
Methods inherited from Base
Constructor Details
#initialize(attributes) ⇒ Message
Returns a new instance of Message.
5 6 7 8 |
# File 'lib/laziness/message.rb', line 5 def initialize(attributes) super symbolize_type attributes[:type] end |
Class Method Details
.generate(attributes) ⇒ Object
11 12 13 14 |
# File 'lib/laziness/message.rb', line 11 def generate(attributes) id = attributes.delete(:id) || generate_id new({ id: id, type: :message }.merge attributes) end |
.generate_id ⇒ Object
16 17 18 |
# File 'lib/laziness/message.rb', line 16 def generate_id SecureRandom.random_number(9999999).to_s end |