module Yoda::Store::Objects

Constants

MODULE_TAIL_PATTERN
VALUE_REGEXP

Public Class Methods

deserialize(hsh) click to toggle source

@param hsh [Hash] @param [Addressable, nil]

# 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) click to toggle source

@param path [Model::Path, String] @return [Array<Path>]

# 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