Class: FansWatch::Attachment
- Inherits:
-
Object
- Object
- FansWatch::Attachment
- Defined in:
- lib/fanswatch/attachment.rb
Overview
Attached URL to Posting
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(data) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(data) ⇒ Attachment
Returns a new instance of Attachment.
6 7 8 9 10 11 12 |
# File 'lib/fanswatch/attachment.rb', line 6 def initialize(data) return unless data @description = data['description'] @url = data['url'] @title = data['title'] @image_url = data['media']['image']['src'] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/fanswatch/attachment.rb', line 4 def description @description end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
4 5 6 |
# File 'lib/fanswatch/attachment.rb', line 4 def image_url @image_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/fanswatch/attachment.rb', line 4 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/fanswatch/attachment.rb', line 4 def url @url end |