Class: TeBot::Message::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/te_bot/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message = {})
  @date = message.dig("date")
  @chat = message.dig("chat")
  @message_id = message.dig("message_id")
  @from = message.dig("from")
  @forward_from = message.dig("forward_from")
  @forward_date = message.dig("forward_date")
  @edit_date = message.dig("edit_date")
  @content = extract_content(message)
  @chat_id = @chat&.dig("id")

  @reply_to_message = message.dig("reply_to_message")
end

Instance Attribute Details

#chatObject (readonly)

Returns the value of attribute chat.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def chat
  @chat
end

#chat_idObject (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

#contentObject (readonly)

Returns the value of attribute content.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def content
  @content
end

#dateObject (readonly)

Returns the value of attribute date.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def date
  @date
end

#edit_dateObject (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_dateObject (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_fromObject (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

#fromObject (readonly)

Returns the value of attribute from.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def from
  @from
end

#message_idObject (readonly)

Returns the value of attribute message_id.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def message_id
  @message_id
end

#reply_to_messageObject (readonly)

Returns the value of attribute reply_to_message.



38
39
40
# File 'lib/te_bot/message.rb', line 38

def reply_to_message
  @reply_to_message
end