Class: BinData::Struct::Snapshot

Inherits:
Hash
  • Object
show all
Defined in:
lib/bindata/struct.rb

Overview

A hash that can be accessed via attributes.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



295
296
297
# File 'lib/bindata/struct.rb', line 295

def method_missing(symbol, *args)
  key?(symbol) ? self[symbol] : super
end

Instance Method Details

#[]=(key, value) ⇒ Object

:nodoc:



287
288
289
# File 'lib/bindata/struct.rb', line 287

def []=(key, value)
  super unless value.nil?
end

#respond_to_missing?(symbol, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


291
292
293
# File 'lib/bindata/struct.rb', line 291

def respond_to_missing?(symbol, include_all = false)
  key?(symbol) || super
end