Class: Bri::Mall

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bri/mall.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#storesObject (readonly)

Returns the value of attribute stores.



9
10
11
# File 'lib/bri/mall.rb', line 9

def stores
  @stores
end

Instance Method Details

#class_methodsObject



15
16
17
18
19
20
21
# File 'lib/bri/mall.rb', line 15

def class_methods
  stores.each_with_object( [] ) do |store, result|
    store.class_methods.each do |klass, methods|
      methods.each { |method| result << "#{klass}.#{method}" }
    end
  end.uniq
end

#classesObject



11
12
13
# File 'lib/bri/mall.rb', line 11

def classes
  stores.flat_map(&:module_names).uniq.sort
end

#instance_methodsObject



23
24
25
26
27
28
29
# File 'lib/bri/mall.rb', line 23

def instance_methods
  stores.each_with_object( [] ) do |store, result|
    store.instance_methods.each do |klass, methods|
      methods.each { |method| result << "#{klass}##{method}" }
    end
  end.uniq
end