Module: Nomener
- Defined in:
- lib/nomener.rb,
lib/nomener/base.rb,
lib/nomener/name.rb,
lib/nomener/parser.rb,
lib/nomener/titles.rb,
lib/nomener/cleaner.rb,
lib/nomener/version.rb,
lib/nomener/suffixes.rb,
lib/nomener/compounders.rb,
lib/nomener/configuration.rb
Overview
configuration module for our names
Defined Under Namespace
Modules: Base, Cleaner, Compounders, Parser, Suffixes, Titles Classes: Configuration, Name, ParseError
Constant Summary collapse
- VERSION =
'0.2.10'- @@config =
hold the configuration object Nomener::Configuration
nil
Class Method Summary collapse
-
.config ⇒ Object
Internal: Read accessor for configuration.
-
.configure {|config| ... } ⇒ Object
Public: to configure the Nomener object can set individually or by block See Nomener::Configuration for more details on what may be set.
-
.parse(name) ⇒ Object
Public: Convenience method to parse a name.
-
.reset ⇒ Object
Public: set the configuration to the Nomener::Configuration defaults.
Class Method Details
.config ⇒ Object
Internal: Read accessor for configuration
Returns the configuration
45 46 47 48 |
# File 'lib/nomener.rb', line 45 def self.config self.configure unless @@config @@config end |
.configure {|config| ... } ⇒ Object
Public: to configure the Nomener object
can set individually or by block
See Nomener::Configuration for more details on what may be set
Returns the configuration object
29 30 31 32 33 |
# File 'lib/nomener.rb', line 29 def self.configure @@config ||= Nomener::Configuration.new yield config if block_given? @@config end |
.parse(name) ⇒ Object
Public: Convenience method to parse a name
name - a string of a name to parse
Returns a <Nomener::Name> or nil if it couldn’t be parsed
20 21 22 |
# File 'lib/nomener.rb', line 20 def self.parse(name) Name.new(name).parse end |
.reset ⇒ Object
Public: set the configuration to the Nomener::Configuration defaults
Returns the configuration object
38 39 40 |
# File 'lib/nomener.rb', line 38 def self.reset @@config = Nomener::Configuration.new end |