Class: Komonjo::Gateway::MessagesGateway
- Inherits:
-
Object
- Object
- Komonjo::Gateway::MessagesGateway
- Defined in:
- lib/komonjo/gateways/messages_gateway.rb
Overview
Merge history and users
Instance Attribute Summary collapse
-
#emojis ⇒ Object
readonly
Returns the value of attribute emojis.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Instance Method Summary collapse
-
#initialize(history, users, emojis) ⇒ MessagesGateway
constructor
A new instance of MessagesGateway.
- #messages ⇒ Object
Constructor Details
#initialize(history, users, emojis) ⇒ MessagesGateway
Returns a new instance of MessagesGateway.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/komonjo/gateways/messages_gateway.rb', line 10 def initialize(history, users, emojis) @history = history.map { |e| Hash[e.symbolize_keys] } @users = users.map do |e| h = Hash[e.symbolize_keys] h[:profile] = Hash[h[:profile].symbolize_keys] Komonjo::Model::User.create(h) end @emojis = emojis.map do |(name, url)| Komonjo::Model::Emoji.create(name, url) end end |
Instance Attribute Details
#emojis ⇒ Object (readonly)
Returns the value of attribute emojis.
8 9 10 |
# File 'lib/komonjo/gateways/messages_gateway.rb', line 8 def emojis @emojis end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
8 9 10 |
# File 'lib/komonjo/gateways/messages_gateway.rb', line 8 def history @history end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
8 9 10 |
# File 'lib/komonjo/gateways/messages_gateway.rb', line 8 def users @users end |