Class: Hyperdrive::Filter
Instance Attribute Summary
Attributes inherited from Param
#constraints, #description, #name, #required, #type
Instance Method Summary collapse
-
#initialize(name, description, options = {}) ⇒ Filter
constructor
A new instance of Filter.
Methods inherited from Param
Constructor Details
#initialize(name, description, options = {}) ⇒ Filter
Returns a new instance of Filter.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/hyperdrive/filter.rb', line 5 def initialize(name, description, = {}) @name = name.to_s @description = description = .merge() @required = if [:required] == true %w(GET HEAD) elsif [:required] == false [] else Array([:required]) end @type = [:type] @constraints = "#{required_constraint} #{[:constraints]}" end |