Class: Wildcard

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Wildcard

Returns a new instance of Wildcard.



6
7
8
# File 'lib/wildcard.rb', line 6

def initialize(text)
  @text = Array(text)
end

Class Method Details

.expand(*args) ⇒ Object



2
3
4
# File 'lib/wildcard.rb', line 2

def self.expand(*args)
  new(*args).expand
end

Instance Method Details

#expandObject



10
11
12
13
14
15
# File 'lib/wildcard.rb', line 10

def expand
  texts = @text
  texts = texts.map{|i| expand_range(i)}.flatten.uniq
  texts = texts.map{|i| expand_selection(i)}.flatten.uniq
  texts
end