class ImageCollage::Runner

Constants

COLLAGE_IMAGE_COUNT

Attributes

keywords[R]
options[R]

Public Class Methods

new(keywords, options) click to toggle source
# File lib/imagecollage/runner.rb, line 8
def initialize(keywords, options)
  @keywords = keywords
  @options = options || {}
end

Public Instance Methods

run() click to toggle source
# File lib/imagecollage/runner.rb, line 13
def run
  flickr_api = ImageCollage::FlickrApi.new(@options.fetch(:flickr_api_key))
  image_url_requester = ImageUrlRequester.new(@keywords, flickr_api, image_url_count: COLLAGE_IMAGE_COUNT)

  collage_generator = CollageGenerator.new(image_url_requester.image_urls)
  collage_generator.generate_image_collage(@options.fetch(:image_collage_path))

  return 0
end