Class: FamilyappSdk::Components::Element
- Inherits:
-
Object
- Object
- FamilyappSdk::Components::Element
- Defined in:
- lib/familyapp_sdk/components/element.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#image ⇒ Object
Returns the value of attribute image.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#subtitle ⇒ Object
Returns the value of attribute subtitle.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #build ⇒ Object
- #build_attributes(attributes) ⇒ Object
-
#initialize(title:, subtitle: nil, image: nil, url: nil, payload: nil, buttons: nil) ⇒ Element
constructor
A new instance of Element.
Constructor Details
#initialize(title:, subtitle: nil, image: nil, url: nil, payload: nil, buttons: nil) ⇒ Element
Returns a new instance of Element.
6 7 8 9 10 11 12 13 |
# File 'lib/familyapp_sdk/components/element.rb', line 6 def initialize(title:, subtitle: nil, image: nil, url: nil, payload: nil, buttons: nil) @title = title @subtitle = subtitle @image = image @url = url @payload = payload @buttons_attributes = build_attributes() end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def @buttons end |
#image ⇒ Object
Returns the value of attribute image.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def image @image end |
#payload ⇒ Object
Returns the value of attribute payload.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def payload @payload end |
#subtitle ⇒ Object
Returns the value of attribute subtitle.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def subtitle @subtitle end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/familyapp_sdk/components/element.rb', line 4 def url @url end |
Instance Method Details
#build ⇒ Object
15 16 17 |
# File 'lib/familyapp_sdk/components/element.rb', line 15 def build instance_values.delete_if { |_attribute, value| value.nil? } end |
#build_attributes(attributes) ⇒ Object
19 20 21 |
# File 'lib/familyapp_sdk/components/element.rb', line 19 def build_attributes(attributes) attributes.map(&:build) if attributes.present? end |