Sha256: fde4497afaed1176b876663fa831bf3fed667091e8b5f3c5cffbe9e92148fa86

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

module Checked
  class Demand
    class Hashs
      
      include Uni_Arch::Base
      include Demand::Base
      namespace '/hash!'

      route
      def check!
        fail!("...must be a Hash") unless hash?(target)
      end

      route
      def symbol_keys!
        keys = target.keys

        if keys.all? { |k| k.is_a?(Symbol) }
          # do nothing
        else
          fail! '...must have all symbol keys.'
        end
      end

    end # === class Hashs
  end # === class Demand
end # === module Checked


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
Checked-1.2.3 lib/Checked/Demand/Hashs.rb
Checked-1.2.2 lib/Checked/Demand/Hashs.rb
Checked-1.2.1 lib/Checked/Demand/Hashs.rb
Checked-1.2.0 lib/Checked/Demand/Hashs.rb
Checked-1.1.0 lib/Checked/Demand/Hashs.rb