class Openra::Struct

Constants

DEFAULT_PROCESSOR
UNDEFINED

Public Class Methods

define(&block) click to toggle source
# File lib/openra/struct.rb, line 28
def define(&block)
  instance_eval(&block)

  preprocessor(preprocessor.with(**{ schema: schema }))

  preprocessor.finalize!
end
inherited(subclass) click to toggle source
Calls superclass method
# File lib/openra/struct.rb, line 23
def inherited(subclass)
  super
  subclass.preprocessor(preprocessor)
end
new(attributes) click to toggle source
Calls superclass method
# File lib/openra/struct.rb, line 36
def new(attributes)
  super(preprocessor.call(attributes))
end
preprocessor(processor = UNDEFINED) click to toggle source
# File lib/openra/struct.rb, line 15
def preprocessor(processor = UNDEFINED)
  if processor === UNDEFINED
    @__preprocessor || DEFAULT_PROCESSOR
  else
    @__preprocessor = processor
  end
end