Class: VKTeams::Button

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

Instance Method Summary collapse

Constructor Details

#initialize(text, style: 'attention', url: nil, call_back_data: nil) ⇒ Button

Returns a new instance of Button.



22
23
24
25
26
27
28
29
# File 'lib/vkteamsbot/message.rb', line 22

def initialize text, style:'attention', url:nil, call_back_data:nil
  @button = {
    'text': text,
    'style': style,
  }
  @button['url'] = url if url
  @button['callbackData'] = call_back_data if call_back_data
end

Instance Method Details

#to_hObject



31
32
33
# File 'lib/vkteamsbot/message.rb', line 31

def to_h
  @button
end