Class: Lerna::Strategy

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(displays) ⇒ Strategy

Returns a new instance of Strategy.



13
14
15
# File 'lib/lerna/strategy.rb', line 13

def initialize(displays)
  @displays = displays
end

Class Method Details

.inherited(subclass) ⇒ Object



7
8
9
10
11
# File 'lib/lerna/strategy.rb', line 7

def self.inherited(subclass)
  name = subclass.to_s.split(/::/).last
  hyphenated = name.scan(/[A-Z][a-z_0-9]+/).map(&:downcase).join('-')
  registry[hyphenated] = subclass
end

.registryObject



3
4
5
# File 'lib/lerna/strategy.rb', line 3

def self.registry
  @registry ||= {}
end