Class: FaceGroup::Attachment
- Inherits:
-
Object
- Object
- FaceGroup::Attachment
- Defined in:
- lib/facegroup/attachment.rb
Overview
Attached URL to Posting
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#media_url ⇒ Object
readonly
Returns the value of attribute media_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.
8 9 10 11 12 13 14 15 |
# File 'lib/facegroup/attachment.rb', line 8 def initialize(data) return unless data = data['data'].first @title = ['title'] @description = ['description'] @url = ['url'] @media_url = &.[]('media')&.[]('image')&.[]('src') end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/facegroup/attachment.rb', line 6 def description @description end |
#media_url ⇒ Object (readonly)
Returns the value of attribute media_url.
6 7 8 |
# File 'lib/facegroup/attachment.rb', line 6 def media_url @media_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/facegroup/attachment.rb', line 6 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/facegroup/attachment.rb', line 6 def url @url end |