Class: ChatSDK::Author
- Inherits:
-
Object
- Object
- ChatSDK::Author
- Defined in:
- lib/chat_sdk/author.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #bot? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(id:, name:, platform:, bot: false, locale: nil, raw: nil) ⇒ Author
constructor
A new instance of Author.
Constructor Details
#initialize(id:, name:, platform:, bot: false, locale: nil, raw: nil) ⇒ Author
Returns a new instance of Author.
7 8 9 10 11 12 13 14 |
# File 'lib/chat_sdk/author.rb', line 7 def initialize(id:, name:, platform:, bot: false, locale: nil, raw: nil) @id = id @name = name @platform = platform @bot = bot @locale = locale @raw = raw end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/chat_sdk/author.rb', line 5 def id @id end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
5 6 7 |
# File 'lib/chat_sdk/author.rb', line 5 def locale @locale end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/chat_sdk/author.rb', line 5 def name @name end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
5 6 7 |
# File 'lib/chat_sdk/author.rb', line 5 def platform @platform end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/chat_sdk/author.rb', line 5 def raw @raw end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
20 21 22 |
# File 'lib/chat_sdk/author.rb', line 20 def ==(other) other.is_a?(Author) && id == other.id && platform == other.platform end |
#bot? ⇒ Boolean
16 17 18 |
# File 'lib/chat_sdk/author.rb', line 16 def bot? @bot end |
#hash ⇒ Object
25 26 27 |
# File 'lib/chat_sdk/author.rb', line 25 def hash [id, platform].hash end |