Class: Sneaql::Core::RegisterMappedClass
- Inherits:
-
Object
- Object
- Sneaql::Core::RegisterMappedClass
- Defined in:
- lib/sneaql_lib/base.rb
Overview
Handles registration of a class to the class_map Ignores duplicate definitions if they occur
Instance Method Summary collapse
-
#initialize(type, text, mapped_class) ⇒ RegisterMappedClass
constructor
Registers the class into the class_map.
Constructor Details
#initialize(type, text, mapped_class) ⇒ RegisterMappedClass
Registers the class into the class_map.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sneaql_lib/base.rb', line 56 def initialize(type, text, mapped_class) Sneaql::Core.insure_type_exists(type) # check to see if the reference text is already being used by this type unless Sneaql::Core.class_map[type].map { |c| c[:text] }.include?(text) Sneaql::Core.add_mapped_class( type, { text: text, mapped_class: mapped_class } ) end end |