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:



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

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
44
# File 'lib/bindata/dsl.rb', line 38

def dsl_parser(parser_type = nil)
  unless defined? @dsl_parser
    parser_type = superclass.dsl_parser.parser_type if parser_type.nil?
    @dsl_parser = DSLParser.new(self, parser_type)
  end
  @dsl_parser
end

#to_aryObject

Assert object is not an array or string.



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

def to_ary; nil; end

#to_strObject



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

def to_str; nil; end