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

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/hashie-5.0.0/lib/hashie/extensions/dash/coercion.rb
hashie-5.0.0 lib/hashie/extensions/dash/coercion.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/hashie-4.1.0/lib/hashie/extensions/dash/coercion.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hashie-3.6.0/lib/hashie/extensions/dash/coercion.rb
hashie-4.1.0 lib/hashie/extensions/dash/coercion.rb
hashie-4.0.0 lib/hashie/extensions/dash/coercion.rb
hashie-3.6.0 lib/hashie/extensions/dash/coercion.rb
tdiary-5.0.8 vendor/bundle/gems/hashie-3.5.7/lib/hashie/extensions/dash/coercion.rb
hashie-3.5.7 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.6 lib/hashie/extensions/dash/coercion.rb
tdiary-5.0.5 vendor/bundle/gems/hashie-3.5.5/lib/hashie/extensions/dash/coercion.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/hashie-3.5.5/lib/hashie/extensions/dash/coercion.rb
tdiary-5.0.4 vendor/bundle/gems/hashie-3.5.5/lib/hashie/extensions/dash/coercion.rb
hashie-3.5.5 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.4 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.3 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.2 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.1 lib/hashie/extensions/dash/coercion.rb
hashie-3.5.0 lib/hashie/extensions/dash/coercion.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/hashie-3.4.6/lib/hashie/extensions/dash/coercion.rb