Class: ChoseInlineResult

Inherits:
Object
  • Object
show all
Defined in:
lib/objects/chosen_inline_result.rb

Overview

Represents a result of an inline query that was chosen by the user

and sent to their chat partner.

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ChoseInlineResult

:nodoc:



10
11
12
# File 'lib/objects/chosen_inline_result.rb', line 10

def initialize(result) # :nodoc:
  @result = result
end

Instance Method Details

#fromObject

The user that chose the result.



20
21
22
# File 'lib/objects/chosen_inline_result.rb', line 20

def from
  User.new(@result.from)
end

#inline_message_idObject

Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.



35
36
37
# File 'lib/objects/chosen_inline_result.rb', line 35

def inline_message_id
  @result.inline_message_id
end

#locationObject

Optional. Sender location, only for bots that require user location.



25
26
27
28
29
30
# File 'lib/objects/chosen_inline_result.rb', line 25

def location
  lcation = @result.location
  return Location.new(lcation) if lcation

  false
end

#queryObject

The query that was used to obtain the result.



40
41
42
# File 'lib/objects/chosen_inline_result.rb', line 40

def query
  @result.query
end

#result_idObject

The unique identifier for the result that was chosen.



15
16
17
# File 'lib/objects/chosen_inline_result.rb', line 15

def result_id
  @result.result_id
end