Class: Orchestrate::Application::SchemaCollection
- Inherits:
-
Object
- Object
- Orchestrate::Application::SchemaCollection
- Defined in:
- lib/orchestrate_application/schema_collection.rb
Overview
Schema support object.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#event_types ⇒ Object
readonly
Returns the value of attribute event_types.
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #define_event_type(event_type, properties) ⇒ Object
- #define_graph(relation_kind, to_collection) ⇒ Object
-
#initialize(args) {|_self| ... } ⇒ SchemaCollection
constructor
args: { :name, :properties, :event_types, :graphs }.
Constructor Details
#initialize(args) {|_self| ... } ⇒ SchemaCollection
args: { :name, :properties, :event_types, :graphs }
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File '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 |
Instance Attribute Details
#event_types ⇒ Object (readonly)
Returns the value of attribute event_types.
6 7 8 |
# File 'lib/orchestrate_application/schema_collection.rb', line 6 def event_types @event_types end |
#graphs ⇒ Object (readonly)
Returns the value of attribute graphs.
6 7 8 |
# File 'lib/orchestrate_application/schema_collection.rb', line 6 def graphs @graphs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/orchestrate_application/schema_collection.rb', line 6 def name @name end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
6 7 8 |
# File 'lib/orchestrate_application/schema_collection.rb', line 6 def properties @properties end |
Instance Method Details
#define_event_type(event_type, properties) ⇒ Object
26 27 28 |
# File '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) ⇒ Object
30 31 32 |
# File '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 |