Skip to content

v3.3.0

Choose a tag to compare

@chawes13 chawes13 released this 03 Nov 02:54
28e2bd4

Items Addressed

  • Now treats all args as with_indifferent_access. I.e., input names can be declared as symbols or strings and incoming hashes can have keys that are symbols or strings.
class TripDecanter < Decanter::Base
  input 'destination', :string
end

TripDecanter.decant({ "destination" => "Hawaii" }) # { destination: "Hawaii" }

is equivalent to

class TripDecanter < Decanter::Base
  input :description, :string
end

TripDecanter.decant({ "destination" => "Hawaii" }) # { destination: "Hawaii" }

which is also equivalent to

class TripDecanter < Decanter::Base
  input 'description', :string
end

TripDecanter.decant({ destination: "Hawaii" }) # { destination: "Hawaii" }