Sha256: 058a4751eff1890303a2ab13b71c91533a565532c21bd8e2769b51f3ffc840e8

Contents?: true

Size: 581 Bytes

Versions: 20

Compression:

Stored size: 581 Bytes

Contents

# encoding: utf-8

module Hyperdrive
  class Filter < Param
    def initialize(name, description, options = {})
      @name = name.to_s
      @description = description
      options = default_options.merge(options)
      @required = if options[:required] == true
                    %w(GET HEAD)
                  elsif options[:required] == false
                    []
                  else
                    Array(options[:required])
                  end
      @type = options[:type]
      @constraints = "#{required_constraint} #{options[:constraints]}"
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 lib/hyperdrive/filter.rb
hyperdrive-0.0.24 lib/hyperdrive/filter.rb
hyperdrive-0.0.23 lib/hyperdrive/filter.rb
hyperdrive-0.0.22 lib/hyperdrive/filter.rb
hyperdrive-0.0.21 lib/hyperdrive/filter.rb
hyperdrive-0.0.20 lib/hyperdrive/filter.rb
hyperdrive-0.0.19 lib/hyperdrive/filter.rb
hyperdrive-0.0.18 lib/hyperdrive/filter.rb
hyperdrive-0.0.17 lib/hyperdrive/filter.rb
hyperdrive-0.0.16 lib/hyperdrive/filter.rb
hyperdrive-0.0.15 lib/hyperdrive/filter.rb
hyperdrive-0.0.14 lib/hyperdrive/filter.rb
hyperdrive-0.0.13 lib/hyperdrive/filter.rb
hyperdrive-0.0.12 lib/hyperdrive/filter.rb
hyperdrive-0.0.11 lib/hyperdrive/filter.rb
hyperdrive-0.0.10 lib/hyperdrive/filter.rb
hyperdrive-0.0.9 lib/hyperdrive/filter.rb
hyperdrive-0.0.8 lib/hyperdrive/filter.rb
hyperdrive-0.0.7 lib/hyperdrive/filter.rb
hyperdrive-0.0.6 lib/hyperdrive/filter.rb