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.
-
#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, raw: nil) ⇒ Author
constructor
A new instance of Author.
Constructor Details
#initialize(id:, name:, platform:, bot: false, raw: nil) ⇒ Author
Returns a new instance of Author.
7 8 9 10 11 12 13 |
# File 'lib/chat_sdk/author.rb', line 7 def initialize(id:, name:, platform:, bot: false, raw: nil) @id = id @name = name @platform = platform @bot = bot @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 |
#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?
19 20 21 |
# File 'lib/chat_sdk/author.rb', line 19 def ==(other) other.is_a?(Author) && id == other.id && platform == other.platform end |
#bot? ⇒ Boolean
15 16 17 |
# File 'lib/chat_sdk/author.rb', line 15 def bot? @bot end |
#hash ⇒ Object
24 25 26 |
# File 'lib/chat_sdk/author.rb', line 24 def hash [id, platform].hash end |