Class: Jot::Ruby::ImplBase
- Inherits:
-
Object
- Object
- Jot::Ruby::ImplBase
- Extended by:
- Utils::Snippets
- Defined in:
- lib/jot/ruby/impl_base.rb
Defined Under Namespace
Modules: Prepender
Constant Summary collapse
- RAW_METHODS =
%i[opFromJSON deserialize diff].freeze
- DEFAULT_OPERATIONS =
[ :NO_OP, # Does nothing :SET, :LIST, # General operations :MATH, # Math :SPLICE, :ATINDEX, :MAP, # Stings and Arrays :PUT, :REM, :APPLY, # Object operations :COPY # Affect structure ].freeze
- DEFAULT_METHODS =
RAW_METHODS + DEFAULT_OPERATIONS
Class Attribute Summary collapse
-
.registry_key ⇒ Object
Returns the value of attribute registry_key.
Class Method Summary collapse
Methods included from Utils::Snippets
Class Attribute Details
.registry_key ⇒ Object
Returns the value of attribute registry_key.
7 8 9 |
# File 'lib/jot/ruby/impl_base.rb', line 7 def registry_key @registry_key end |
Class Method Details
.inherited(base) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/jot/ruby/impl_base.rb', line 16 def inherited(base) super base.prepend Prepender base.registry_key = SecureRandom.hex ::Jot::Ruby.impl_registry[base.registry_key] = base end |
.operation_class ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/jot/ruby/impl_base.rb', line 24 def self.operation_class @operation_class ||= begin klass = Class.new(Operation) klass.include self::OperationMethods klass end end |