Class: FamilyappSdk::Components::Button

Inherits:
Object
  • Object
show all
Defined in:
lib/familyapp_sdk/components/button.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, title:, payload: nil, web_url: nil) ⇒ Button

Returns a new instance of Button.



6
7
8
9
10
11
# File 'lib/familyapp_sdk/components/button.rb', line 6

def initialize(type:, title:, payload: nil, web_url: nil)
  @button_type  = type
  @title = title
  @payload = payload
  @web_url = web_url
end

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



4
5
6
# File 'lib/familyapp_sdk/components/button.rb', line 4

def payload
  @payload
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/familyapp_sdk/components/button.rb', line 4

def title
  @title
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/familyapp_sdk/components/button.rb', line 4

def type
  @type
end

#web_urlObject

Returns the value of attribute web_url.



4
5
6
# File 'lib/familyapp_sdk/components/button.rb', line 4

def web_url
  @web_url
end

Instance Method Details

#buildObject



13
14
15
# File 'lib/familyapp_sdk/components/button.rb', line 13

def build
  instance_values.delete_if { |_attribute, value| value.nil? }
end