lib/ui/image_attachment.rb in rubotnik-0.1.1 vs lib/ui/image_attachment.rb in rubotnik-0.2.0
- old
+ new
@@ -1,9 +1,9 @@
# rubocop:disable Metrics/MethodLength
module UI
# https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment
- class ImageAttachment
+ class ImageAttachment < UI::BaseUiElement
def initialize(url)
@template = {
recipient: {
id: nil
},
@@ -14,18 +14,8 @@
url: url
}
}
}
}
- end
-
- def send(user)
- formed = build(user)
- Bot.deliver(formed, access_token: ENV['ACCESS_TOKEN'])
- end
-
- def build(user)
- @template[:recipient][:id] = user.id
- @template
end
end
end