Module: Kwalify::Util::HashLike

Module | Kwalify::Util::HashLike
In: | kwalify/util/hashlike.rb

add hash-like methods

### Methods

[] []= each key? key?

### Public Instance methods

[](key)

[Source]

    # File kwalify/util/hashlike.rb, line 16
          def [](key)
            instance_variable_get("@#{key}")
          end

[]=(key, val)

[Source]

    # File kwalify/util/hashlike.rb, line 20
          def []=(key, val)
            instance_variable_set("@#{key}", val)
          end

each( {|key, val| ...}

[Source]

    # File kwalify/util/hashlike.rb, line 39
          def each   # not necessary
            instance_variables().each do |name|
              key = name[1, name.length-1]
              val = instance_variable_get(name)
              yield(key, val)
            end
          end

key?(key)

[Source]

    # File kwalify/util/hashlike.rb, line 34
            def key?(key)
              instance_variable_defined?("@#{key}")
            end

key?(key)

[Source]

    # File kwalify/util/hashlike.rb, line 30
          def key?(key)
            instance_variables().include?("@#{key}")
          end

[Validate]