Module: Krikri::MappingDSL

Extended by:
ActiveSupport::Concern
Includes:
ParserMethods, RdfSubjects
Included in:
Mapping
Defined in:
lib/krikri/mapping_dsl.rb,
lib/krikri/mapping_dsl/rdf_subjects.rb,
lib/krikri/mapping_dsl/parser_methods.rb,
lib/krikri/mapping_dsl/child_declaration.rb,
lib/krikri/mapping_dsl/property_declaration.rb

Overview

Mixin implementing DSL methods for metadata mapping. The main MappingDSL module implements the core property definition methods, while nested modules add various extensions.

Defined Under Namespace

Modules: ParserMethods, RdfSubjects Classes: ChildDeclaration, PropertyDeclaration

Instance Method Summary collapse

Methods included from RdfSubjects

#uri

Methods included from ParserMethods

#header, #local_name, #record, #record_uri

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ PropertyDeclaration, ChildDeclaration

The class responds to all methods; treating any not defined as property/child declarations.



36
37
38
39
# File 'lib/krikri/mapping_dsl.rb', line 36

def method_missing(name, *args, &block)
  return add_child(name, *args, &block) if block && block.arity == 0
  add_property(name, *args, &block)
end

Instance Method Details

#propertiesArray<PropertyDeclaration, ChildDeclaration>

List the property and child declarations set on mapping.



20
21
22
# File 'lib/krikri/mapping_dsl.rb', line 20

def properties
  @properties ||= []
end

#respond_to_missing?true

Returns:

  • (true)

See Also:



27
28
29
# File 'lib/krikri/mapping_dsl.rb', line 27

def respond_to_missing?(*)
  true
end