Method: Sinclair#build

Defined in:
lib/sinclair.rb

#buildArray<MethodDefinition>

builds all the methods added into the klass

Examples:

Adding a default value method


class MyModel
end

buider = Sinclair.new(MyModel)

builder.add_method(:default_value) { value }

MyModel.new.respond_to(:default_value) # returns false

builder.build

MyModel.new.respond_to(:default_value) # returns true

Returns:



196
197
198
199
# File 'lib/sinclair.rb', line 196

def build
  builder.build_methods(definitions, MethodBuilder::INSTANCE_METHOD)
  builder.build_methods(class_definitions, MethodBuilder::CLASS_METHOD)
end