lib/facegroup/attachment.rb in facegroup-0.1.0 vs lib/facegroup/attachment.rb in facegroup-0.2.0
- old
+ new
@@ -1,14 +1,16 @@
# frozen_string_literal: true
module FaceGroup
# Attached URL to Posting
class Attachment
- attr_reader :description, :url
+ attr_reader :title, :description, :url
def initialize(data)
return unless data
- @description = data['description']
- @url = data['url']
+ attachment_data = data['data'].first
+ @title = attachment_data['title']
+ @description = attachment_data['description']
+ @url = attachment_data['url']
end
end
end