Module: BinData::DSLMixin

Included in:
Array, Buffer, Choice, DelayedIO, Primitive, Record
Defined in:
lib/bindata/dsl.rb

Overview

BinData classes that are part of the DSL must be extended by this.

Defined Under Namespace

Classes: DSLBigAndLittleEndianHandler, DSLFieldParser, DSLFieldValidator, DSLParser

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object

:nodoc:



45
46
47
# File 'lib/bindata/dsl.rb', line 45

def method_missing(symbol, *args, &block) #:nodoc:
  dsl_parser.__send__(symbol, *args, &block)
end

Instance Method Details

#dsl_parser(parser_type = nil) ⇒ Object



38
39
40
41
42
43
# File 'lib/bindata/dsl.rb', line 38

def dsl_parser(parser_type = nil)
  @dsl_parser ||= begin
    parser_type ||= superclass.dsl_parser.parser_type
    DSLParser.new(self, parser_type)
  end
end

#to_aryObject

Assert object is not an array or string.



50
# File 'lib/bindata/dsl.rb', line 50

def to_ary; nil; end

#to_strObject



51
# File 'lib/bindata/dsl.rb', line 51

def to_str; nil; end