Module: BinData::DSLMixin::ClassMethods

Defined in:
lib/bindata/dsl.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

:nodoc:



23
24
25
# File 'lib/bindata/dsl.rb', line 23

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

Instance Method Details

#dsl_parser(*args) ⇒ Object

Defines the DSL Parser for this BinData object. Allowed args are:

:only_one_field

Only one field may be declared.

:multiple_fields

Multiple fields may be declared.

:hidden_fields

Hidden fields are allowed.

:sanitize_fields

Fields are to be sanitized.

:mandatory_fieldnames

Fieldnames are mandatory.

:optional_fieldnames

Fieldnames are optional.

:no_fieldnames

Fieldnames are prohibited.

:all_or_none_fieldnames

All fields must have names, or none may have names.



19
20
21
# File 'lib/bindata/dsl.rb', line 19

def dsl_parser(*args)
  @dsl_parser ||= DSLParser.new(self, *args)
end