Sha256: 9611f5607725af4c1ba562da2449a917b720c71dabf32ac2e15c747dd0268eee

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

module VideoGrabber

  # Access point for the gem configurations.
  #
  # @return [VideoGrabber::Configuration] a configuration instance.
  def self.config
    @config ||= Configuration.new
  end

  # Configure hook used in the gem initializer. Convinient way to set all the
  # gem configurations.
  #
  # example:
  #   VideoGrabber.configure do |config|
  #     config.timeout = 60
  #   end
  #
  # @return [void]
  def self.configure
    yield config if block_given?
  end

  class Configuration

    attr_accessor :url, :keep_browser_open, :timeout, :headless_enabled,
                  :firefox_extension_path, :html_attributes

    def initialize
      @keep_browser_open = false
      @timeout           = 60
      @headless_enabled  = true
      @html_attributes   = { controls: true }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
video_grabber-1.7.0 lib/video_grabber/config.rb
video_grabber-1.6.0 lib/video_grabber/config.rb