Class: Lita::GoogleGroup
- Inherits:
-
Object
- Object
- Lita::GoogleGroup
- Defined in:
- lib/lita/google_group.rb
Overview
A google email group
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#member_count ⇒ Object
readonly
Returns the value of attribute member_count.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, email:, name:, member_count:, description:) ⇒ GoogleGroup
constructor
A new instance of GoogleGroup.
- #to_s ⇒ Object
Constructor Details
#initialize(id:, email:, name:, member_count:, description:) ⇒ GoogleGroup
Returns a new instance of GoogleGroup.
16 17 18 19 |
# File 'lib/lita/google_group.rb', line 16 def initialize(id:, email:, name:, member_count:, description:) @id, @email, @name, @description = id, email, name, description @member_count = member_count.to_i end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/lita/google_group.rb', line 4 def description @description end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
4 5 6 |
# File 'lib/lita/google_group.rb', line 4 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/lita/google_group.rb', line 4 def id @id end |
#member_count ⇒ Object (readonly)
Returns the value of attribute member_count.
4 5 6 |
# File 'lib/lita/google_group.rb', line 4 def member_count @member_count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/lita/google_group.rb', line 4 def name @name end |
Class Method Details
.from_api(group) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/lita/google_group.rb', line 6 def self.from_api(group) GoogleGroup.new( id: group.id, email: group.email, name: group.name, description: group.description, member_count: group.direct_members_count, ) end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/lita/google_group.rb', line 21 def ==(other) @id == other.id && @email == other.email end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/lita/google_group.rb', line 25 def to_s @email end |