Class: Desiru::Signature::FieldHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/desiru/signature.rb

Overview

FieldHash allows access by both string and symbol keys

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



44
45
46
47
# File 'lib/desiru/signature.rb', line 44

def [](key)
  field = super(key.to_sym)
  field ? FieldWrapper.new(field) : nil
end

#[]=(key, value) ⇒ Object



49
50
51
# File 'lib/desiru/signature.rb', line 49

def []=(key, value)
  super(key.to_sym, value)
end

#key?(key) ⇒ Boolean Also known as: include?, has_key?

Returns:

  • (Boolean)


57
58
59
# File 'lib/desiru/signature.rb', line 57

def key?(key)
  super(key.to_sym)
end

#keysObject



53
54
55
# File 'lib/desiru/signature.rb', line 53

def keys
  super.map(&:to_s)
end