Class: TeBot::Message::Format
- Inherits:
-
Object
- Object
- TeBot::Message::Format
- Defined in:
- lib/te_bot/message.rb
Instance Attribute Summary collapse
-
#chat ⇒ Object
readonly
Returns the value of attribute chat.
-
#chat_id ⇒ Object
readonly
Returns the value of attribute chat_id.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#edit_date ⇒ Object
readonly
Returns the value of attribute edit_date.
-
#forward_date ⇒ Object
readonly
Returns the value of attribute forward_date.
-
#forward_from ⇒ Object
readonly
Returns the value of attribute forward_from.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#reply_to_message ⇒ Object
readonly
Returns the value of attribute reply_to_message.
Instance Method Summary collapse
-
#initialize(message = {}) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(message = {}) ⇒ Format
Returns a new instance of Format.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/te_bot/message.rb', line 41 def initialize( = {}) @date = .dig("date") @chat = .dig("chat") @message_id = .dig("message_id") @from = .dig("from") @forward_from = .dig("forward_from") @forward_date = .dig("forward_date") @edit_date = .dig("edit_date") @content = extract_content() @chat_id = @chat&.dig("id") @reply_to_message = .dig("reply_to_message") end |
Instance Attribute Details
#chat ⇒ Object (readonly)
Returns the value of attribute chat.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def chat @chat end |
#chat_id ⇒ Object (readonly)
Returns the value of attribute chat_id.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def chat_id @chat_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def content @content end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def date @date end |
#edit_date ⇒ Object (readonly)
Returns the value of attribute edit_date.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def edit_date @edit_date end |
#forward_date ⇒ Object (readonly)
Returns the value of attribute forward_date.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def forward_date @forward_date end |
#forward_from ⇒ Object (readonly)
Returns the value of attribute forward_from.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def forward_from @forward_from end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def from @from end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def @message_id end |
#reply_to_message ⇒ Object (readonly)
Returns the value of attribute reply_to_message.
38 39 40 |
# File 'lib/te_bot/message.rb', line 38 def @reply_to_message end |