Class: Desiru::Signature::FieldHash
- Inherits:
-
Hash
- Object
- Hash
- Desiru::Signature::FieldHash
- Defined in:
- lib/desiru/signature.rb
Overview
FieldHash allows access by both string and symbol keys
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #key?(key) ⇒ Boolean (also: #include?, #has_key?)
- #keys ⇒ Object
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?
57 58 59 |
# File 'lib/desiru/signature.rb', line 57 def key?(key) super(key.to_sym) end |
#keys ⇒ Object
53 54 55 |
# File 'lib/desiru/signature.rb', line 53 def keys super.map(&:to_s) end |