Class: Lita::Adapters::Slack::SlackUser
- Inherits:
-
Object
- Object
- Lita::Adapters::Slack::SlackUser
- Defined in:
- lib/lita/adapters/slack/slack_user.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#real_name ⇒ Object
readonly
Returns the value of attribute real_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name, real_name, raw_data) ⇒ SlackUser
constructor
A new instance of SlackUser.
Constructor Details
#initialize(id, name, real_name, raw_data) ⇒ SlackUser
Returns a new instance of SlackUser.
25 26 27 28 29 30 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 25 def initialize(id, name, real_name, raw_data) @id = id @name = name @real_name = real_name.to_s @raw_data = raw_data end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
20 21 22 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 20 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 21 def name @name end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
23 24 25 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 23 def raw_data @raw_data end |
#real_name ⇒ Object (readonly)
Returns the value of attribute real_name.
22 23 24 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 22 def real_name @real_name end |
Class Method Details
.from_data(user_data) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 6 def from_data(user_data) new( user_data['id'], user_data['name'], user_data['real_name'], user_data ) end |
.from_data_array(users_data) ⇒ Object
15 16 17 |
# File 'lib/lita/adapters/slack/slack_user.rb', line 15 def from_data_array(users_data) users_data.map { |user_data| from_data(user_data) } end |