class Orchestrate::Application::SchemaCollection

Schema support object.

Attributes

event_types[R]
graphs[R]
name[R]
properties[R]

Public Class Methods

new(args) { |self| ... } click to toggle source

args: { :name, :properties, :event_types, :graphs }

# File rails/lib/orchestrate_application/schema_collection.rb, line 10
def initialize(args)
  @name, @properties = args[:name], args[:properties] + [:id]

  @event_types = {}
  if args[:event_types]
    args[:event_types].each { |etype| @event_types[etype] = etype }
  end

  @graphs = {}
  if args[:graphs]
    args[:graphs].each { |kind| @graphs[kind] = kind }
  end

  yield self if block_given?
end

Public Instance Methods

define_event_type(event_type, properties) click to toggle source
# File rails/lib/orchestrate_application/schema_collection.rb, line 26
def define_event_type(event_type, properties)
 @event_types[event_type] = SchemaEventType.new(event_type, properties)
end
define_graph(relation_kind, to_collection) click to toggle source
# File rails/lib/orchestrate_application/schema_collection.rb, line 30
def define_graph(relation_kind, to_collection)
  @graphs[relation_kind] = SchemaGraph.new(relation_kind, to_collection)
end