module RbPath::ObjectMixin

Public Instance Methods

path_values(paths) click to toggle source
# File lib/rbpath/object_mixin.rb, line 11
def path_values(paths)
  RbPath::Query.new(*query).values_at(self, paths)
end
pquery(*query) click to toggle source
# File lib/rbpath/object_mixin.rb, line 7
def pquery(*query)
  RbPath::Query.new(*query).pquery(self)
end
query(*query) click to toggle source
# File lib/rbpath/object_mixin.rb, line 3
def query(*query)
  RbPath::Query.new(*query).query(self)
end
rbpath_fields() click to toggle source

The object’s class may not have the ClassMixin if a singleton object was extended:

h = { a: 1, b: 2} h.extend RbPath

# File lib/rbpath/object_mixin.rb, line 21
def rbpath_fields
  self.class.respond_to?(:rbpath_fields) ?
    self.class.rbpath_fields : nil
end