module Sparsify::GuardMethods
Methods to ensure Sparsify
isn't mixed into nonsensical things
Public Instance Methods
extended(base)
click to toggle source
Sparsify
can be extended into instances of Hash @param base [Hash]
# File lib/sparsify/guard_methods.rb, line 8 def extended(base) unless base.is_a? Hash raise ArgumentError, "<#{base.inspect}> is not a Hash!" end end
included(base)
click to toggle source
Sparsigy can be included into implementations of Hash @param base [Hash.class]
# File lib/sparsify/guard_methods.rb, line 16 def included(base) unless base <= Hash raise ArgumentError, "<#{base.inspect} does not inherit Hash" end end