Module: Yoda::Store::Objects

Defined in:
lib/yoda/store/objects.rb,
lib/yoda/store/objects/tag.rb,
lib/yoda/store/objects/base.rb,
lib/yoda/store/objects/patch.rb,
lib/yoda/store/objects/merger.rb,
lib/yoda/store/objects/overload.rb,
lib/yoda/store/objects/patch_set.rb,
lib/yoda/store/objects/patchable.rb,
lib/yoda/store/objects/addressable.rb,
lib/yoda/store/objects/class_object.rb,
lib/yoda/store/objects/serializable.rb,
lib/yoda/store/objects/value_object.rb,
lib/yoda/store/objects/method_object.rb,
lib/yoda/store/objects/module_object.rb,
lib/yoda/store/objects/project_status.rb,
lib/yoda/store/objects/namespace_object.rb,
lib/yoda/store/objects/meta_class_object.rb

Defined Under Namespace

Modules: Addressable, Patchable, Serializable Classes: Base, ClassObject, Merger, MetaClassObject, MethodObject, ModuleObject, NamespaceObject, Overload, Patch, PatchSet, ProjectStatus, Tag, ValueObject

Constant Summary collapse

VALUE_REGEXP =
/\A[0-9a-z]/
MODULE_TAIL_PATTERN =
/(?:::(\w+)|^(\w+))$/

Class Method Summary collapse

Class Method Details

.deserialize(hsh) ⇒ Object

Parameters:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/yoda/store/objects.rb', line 27

def deserialize(hsh)
  case hsh[:type].to_sym
  when :class
    ClassObject.new(hsh)
  when :module
    ModuleObject.new(hsh)
  when :meta_class
    MetaClassObject.new(hsh)
  when :value
    ValueObject.new(hsh)
  when :method
    MethodObject.new(hsh)
  end
end

.lexical_scopes_of(path) ⇒ Array<Path>

Parameters:

Returns:

  • (Array<Path>)


44
45
46
# File 'lib/yoda/store/objects.rb', line 44

def lexical_scopes_of(path)
  Model::Path.build(path).parent_paths.map { |name| Model::Path.build(name) } + [Model::Path.new('Object')]
end