Class: Telegem::Types::Chat
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from BaseType
Instance Method Summary collapse
- #channel? ⇒ Boolean
- #group? ⇒ Boolean
-
#initialize(data) ⇒ Chat
constructor
A new instance of Chat.
- #private? ⇒ Boolean
- #supergroup? ⇒ Boolean
Methods inherited from BaseType
#method_missing, #respond_to_missing?
Constructor Details
#initialize(data) ⇒ Chat
Returns a new instance of Chat.
62 63 64 65 66 67 68 69 |
# File 'lib/api/types.rb', line 62 def initialize(data) super(data) @id = data['id'] @type = data['type'] @username = data['username'] @title = data['title'] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Telegem::Types::BaseType
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
60 61 62 |
# File 'lib/api/types.rb', line 60 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
60 61 62 |
# File 'lib/api/types.rb', line 60 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
60 61 62 |
# File 'lib/api/types.rb', line 60 def type @type end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
60 61 62 |
# File 'lib/api/types.rb', line 60 def username @username end |
Instance Method Details
#channel? ⇒ Boolean
83 84 85 |
# File 'lib/api/types.rb', line 83 def channel? type == 'channel' end |
#group? ⇒ Boolean
75 76 77 |
# File 'lib/api/types.rb', line 75 def group? type == 'group' end |
#private? ⇒ Boolean
71 72 73 |
# File 'lib/api/types.rb', line 71 def private? type == 'private' end |
#supergroup? ⇒ Boolean
79 80 81 |
# File 'lib/api/types.rb', line 79 def supergroup? type == 'supergroup' end |