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



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

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

Instance Method Details

#[]=(key, value) ⇒ Object

:nodoc:



279
280
281
# File 'lib/bindata/struct.rb', line 279

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

#respond_to?(symbol, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


283
284
285
# File 'lib/bindata/struct.rb', line 283

def respond_to?(symbol, include_private = false)
  key?(symbol) || super
end