Class: ReeHash::HashKeysContract
- Inherits:
-
Object
- Object
- ReeHash::HashKeysContract
- Extended by:
- Ree::Contracts::Truncatable
- Defined in:
- lib/ree_lib/packages/ree_hash/package/ree_hash/contracts/hash_keys_contract.rb
Class Method Summary collapse
Class Method Details
.message(value, name, lvl = 1) ⇒ Object
16 17 18 |
# File 'lib/ree_lib/packages/ree_hash/package/ree_hash/contracts/hash_keys_contract.rb', line 16 def self.(value, name, lvl = 1) "expected #{to_s}, got => #{truncate(value.inspect)}" end |
.to_s ⇒ Object
12 13 14 |
# File 'lib/ree_lib/packages/ree_hash/package/ree_hash/contracts/hash_keys_contract.rb', line 12 def self.to_s "[:key0, .., :keyM => [:keyN, .., :keyZ]]" end |
.valid?(obj) ⇒ Boolean
6 7 8 9 10 |
# File 'lib/ree_lib/packages/ree_hash/package/ree_hash/contracts/hash_keys_contract.rb', line 6 def self.valid?(obj) return false if !obj.is_a?(Array) return false if obj.any? { !valid_item?(_1) } true end |