Class: Messages::MessageAttachment
- Inherits:
-
Object
- Object
- Messages::MessageAttachment
- Defined in:
- lib/yellowant/message/message_attachment.rb
Instance Attribute Summary collapse
-
#author_icon ⇒ Object
Returns the value of attribute author_icon.
-
#author_link ⇒ Object
Returns the value of attribute author_link.
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#color ⇒ Object
Returns the value of attribute color.
-
#footer ⇒ Object
Returns the value of attribute footer.
-
#footer_icon ⇒ Object
Returns the value of attribute footer_icon.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#pretext ⇒ Object
Returns the value of attribute pretext.
-
#status ⇒ Object
Returns the value of attribute status.
-
#text ⇒ Object
Returns the value of attribute text.
-
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_link ⇒ Object
Returns the value of attribute title_link.
-
#ts ⇒ Object
Returns the value of attribute ts.
Instance Method Summary collapse
- #attach_button(button) ⇒ Object
- #attach_field(field) ⇒ Object
- #get_dict ⇒ Object
-
#initialize ⇒ MessageAttachment
constructor
A new instance of MessageAttachment.
Constructor Details
#initialize ⇒ MessageAttachment
Returns a new instance of MessageAttachment.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/yellowant/message/message_attachment.rb', line 9 def initialize @image_url = '' @thumb_url = '' @color = '' @text = '' = '' = '' = '' = '' = '' @pretext = '' @title = '' @title_link = '' @status = 0 @ts = 0 @fields = Array.new = Array.new end |
Instance Attribute Details
#author_icon ⇒ Object
Returns the value of attribute author_icon.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def end |
#author_link ⇒ Object
Returns the value of attribute author_link.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def end |
#author_name ⇒ Object
Returns the value of attribute author_name.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def end |
#color ⇒ Object
Returns the value of attribute color.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def color @color end |
#footer ⇒ Object
Returns the value of attribute footer.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def end |
#footer_icon ⇒ Object
Returns the value of attribute footer_icon.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def end |
#image_url ⇒ Object
Returns the value of attribute image_url.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def image_url @image_url end |
#pretext ⇒ Object
Returns the value of attribute pretext.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def pretext @pretext end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def status @status end |
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def text @text end |
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def thumb_url @thumb_url end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def title @title end |
#title_link ⇒ Object
Returns the value of attribute title_link.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def title_link @title_link end |
#ts ⇒ Object
Returns the value of attribute ts.
7 8 9 |
# File 'lib/yellowant/message/message_attachment.rb', line 7 def ts @ts end |
Instance Method Details
#attach_button(button) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/yellowant/message/message_attachment.rb', line 36 def () if !field.is_a? ButtonClass raise YellowantExceptions::YellowAntError, "Attachment must be 'AttachmentClass' class" else << .get_dict end end |
#attach_field(field) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/yellowant/message/message_attachment.rb', line 28 def attach_field(field) if !field.is_a? AttachmentClass raise YellowantExceptions::YellowAntError, "Attachment must be 'AttachmentClass' class" else @field << field.get_dict end end |
#get_dict ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/yellowant/message/message_attachment.rb', line 44 def get_dict if !@status.is_a? Integer raise YellowantExceptions::YellowAntError, ":status must be an integer" elsif !@ts.is_a? Integer raise YellowantExceptions::YellowAntError, ":ts must be an integer" end {"image_url"=> @image_url, "thumb_url"=> @thumb_url, "color"=> @color, "text"=> @text, "author_name"=> , "author_icon"=> , "author_link"=> , "ts"=> @ts, "footer"=> , "footer_icon"=> , "pretext"=> @pretext, "title"=> @title, "title_link"=> @title_link, "status"=> @status, "fields"=> @fields, "buttons"=> } end |