Sha256: 15fe144293c6cdc87fa31ce801d80391263f08ce72288a1f73c2ebdd9ef1831f

Contents?: true

Size: 1004 Bytes

Versions: 3

Compression:

Stored size: 1004 Bytes

Contents

module RDee
  module AdditionalOptions

    def additional_options_for(target)
      options = {}
      options.merge!(chrome_options) if need_chrome_options? target
      options.merge!(firefox_options) if need_firefox_options? target
      options.merge!(ie_options) if need_ie_optons? target
      options.merge!(safari_options) if need_safari_options? target
      options.merge!(iphone_options) if need_iphone_options? target
      options
    end

    def need_chrome_options?(target)
      not chrome_options.nil? and target.to_s.include? 'chrome'
    end

    def need_firefox_options?(target)
      not firefox_options.nil? and target.to_s.include? 'firefox'
    end

    def need_ie_optons?(target)
      not ie_options.nil? and target.to_s.include? 'ie'
    end

    def need_safari_options?(target)
      not safari_options.nil? and target.to_s.include? 'safari'
    end

    def need_iphone_options?(target)
      not iphone_options.nil? and target.to_s.include? 'iphone'
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
RDee-0.6 lib/rdee/additional_options.rb
RDee-0.5 lib/rdee/additional_options.rb
RDee-0.4 lib/rdee/additional_options.rb