Class: SimpleNavigation::ConfigFile
- Inherits:
-
Object
- Object
- SimpleNavigation::ConfigFile
- Defined in:
- lib/simple_navigation/config_file.rb
Overview
Internal: Encapsulates the config file naming knowledge.
Instance Method Summary collapse
-
#initialize(context) ⇒ ConfigFile
constructor
Internal: Initializes a ConfigFile.
-
#name ⇒ Object
Internal: Returns the name of the configuration file on disk.
Constructor Details
#initialize(context) ⇒ ConfigFile
Internal: Initializes a ConfigFile.
context - The navigation context for this ConfigFile.
9 10 11 |
# File 'lib/simple_navigation/config_file.rb', line 9 def initialize(context) @prefix = prefix_for_context(context) end |
Instance Method Details
#name ⇒ Object
Internal: Returns the name of the configuration file on disk.
Based on the the initialization context the outcome may differ.
Examples
ConfigFile.new.name # => "navigation.rb"
ConfigFile.new(:default).name # => "navigation.rb"
ConfigFile.new(:other).name # => "other_navigation.rb"
Returns a String representing the name of the configuration file on disk.
24 25 26 |
# File 'lib/simple_navigation/config_file.rb', line 24 def name @name ||= "#{prefix}navigation.rb" end |