Sha256: 8faa45a982deedfdb2bb02f6b60c262b5a35713ed317cff751a23ad0100b62c5
Contents?: true
Size: 739 Bytes
Versions: 26
Compression:
Stored size: 739 Bytes
Contents
module Hashie module Extensions module Dash module Coercion # Extends a Dash with the ability to define coercion for properties. def self.included(base) base.send :include, Hashie::Extensions::Coercion base.extend ClassMethods end module ClassMethods # Defines a property on the Dash. Options are the standard # <tt>Hashie::Dash#property</tt> options plus: # # * <tt>:coerce</tt> - The class into which you want the property coerced. def property(property_name, options = {}) super coerce_key property_name, options[:coerce] if options[:coerce] end end end end end end
Version data entries
26 entries across 24 versions & 5 rubygems