Class: Glob::Map

Inherits:
Object
  • Object
show all
Defined in:
lib/glob/map.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Map

Returns a new instance of Map.



9
10
11
# File 'lib/glob/map.rb', line 9

def initialize(target)
  @target = target
end

Class Method Details

.call(target) ⇒ Object



5
6
7
# File 'lib/glob/map.rb', line 5

def self.call(target)
  new(target).call
end

Instance Method Details

#callObject



13
14
15
16
17
18
# File 'lib/glob/map.rb', line 13

def call
  @target
    .map {|(key, value)| compute(value, escape(key)) }
    .flatten
    .sort
end