Sha256: 562d50687f8741c22f4bbb0a454a986e126ae29d4853aa84504830c61b3c23cb

Contents?: true

Size: 308 Bytes

Versions: 4

Compression:

Stored size: 308 Bytes

Contents

module Hashie
  module Extensions
    module Mash
      module SafeAssignment
        def assign_property(name, value)
          fail ArgumentError, "The property #{name} clashes with an existing method." if methods.include?(name.to_sym)

          self[name] = value
        end
      end
    end
  end
end

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
hashie-3.3.2 lib/hashie/extensions/mash/safe_assignment.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/hashie-3.3.1/lib/hashie/extensions/mash/safe_assignment.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/hashie-3.3.1/lib/hashie/extensions/mash/safe_assignment.rb
hashie-3.3.1 lib/hashie/extensions/mash/safe_assignment.rb