Class: Levels::System::KeyFormatter
- Inherits:
-
Object
- Object
- Levels::System::KeyFormatter
- Defined in:
- lib/levels/system/key_formatter.rb
Instance Method Summary collapse
- #create(*parts) ⇒ Object
-
#initialize(prefix = nil, joiner = nil) ⇒ KeyFormatter
constructor
A new instance of KeyFormatter.
Constructor Details
#initialize(prefix = nil, joiner = nil) ⇒ KeyFormatter
Returns a new instance of KeyFormatter.
5 6 7 8 |
# File 'lib/levels/system/key_formatter.rb', line 5 def initialize(prefix = nil, joiner = nil) @prefix = prefix || "" @joiner = joiner || "_" end |
Instance Method Details
#create(*parts) ⇒ Object
10 11 12 |
# File 'lib/levels/system/key_formatter.rb', line 10 def create(*parts) (@prefix + parts.join(@joiner)).upcase end |