Module: Gem::Release::Registry::ClassMethods

Defined in:
lib/gem/release/support/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#registry_keyObject (readonly)

Returns the value of attribute registry_key.



30
31
32
# File 'lib/gem/release/support/registry.rb', line 30

def registry_key
  @registry_key
end

Instance Method Details

#[](key) ⇒ Object



32
33
34
# File 'lib/gem/release/support/registry.rb', line 32

def [](key)
  registry[key.to_sym]
end

#register(key) ⇒ Object



36
37
38
39
# File 'lib/gem/release/support/registry.rb', line 36

def register(key)
  registry[key] = self
  @registry_key = key.to_sym
end

#registryObject



41
42
43
# File 'lib/gem/release/support/registry.rb', line 41

def registry
  @registry ||= superclass.respond_to?(:registry) ? superclass.registry : Registry.new
end

#underscore(string) ⇒ Object



45
46
47
48
49
# File 'lib/gem/release/support/registry.rb', line 45

def underscore(string)
  string.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  downcase
end