Module: Ronflex
- Defined in:
- lib/ronflex/rule.rb,
lib/ronflex.rb,
lib/ronflex/rest.rb,
lib/ronflex/version.rb,
lib/ronflex/railties.rb,
lib/ronflex/configuration.rb
Overview
# add rule for guest
config.add_rule(:guest) do |user, request|
# guests can only acces public path
request.path.start_with?("/public")
end
# add custom page maintenance
config.maintenance_page = "/path/to/your/custom/maintenance/page.html"
end
Defined Under Namespace
Classes: Configuration, Railtie, Rest, Rule
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.configuration ⇒ Snorlax::Configuration
Accesses global configuration.
-
.configure {|config| ... } ⇒ Object
Method to configure ‘Snorlax` with a block.
-
.play_pokeflute ⇒ void
Simulates playing the Pokéflute, disabling a feature.
-
.stop_pokeflute ⇒ void
Simulates stopping the Pokéflute, enabling a feature.
Class Method Details
.configuration ⇒ Snorlax::Configuration
Accesses global configuration
20 21 22 |
# File 'lib/ronflex.rb', line 20 def configuration @configuration ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
Method to configure ‘Snorlax` with a block
12 13 14 15 |
# File 'lib/ronflex.rb', line 12 def configure @configuration ||= Configuration.new yield @configuration if block_given? end |
.play_pokeflute ⇒ void
This method returns an undefined value.
Simulates playing the Pokéflute, disabling a feature.
This method modifies the global configuration to enable a specific feature.
29 30 31 |
# File 'lib/ronflex.rb', line 29 def play_pokeflute configuration.enable = false end |
.stop_pokeflute ⇒ void
This method returns an undefined value.
Simulates stopping the Pokéflute, enabling a feature.
This method modifies the global configuration to disable a specific feature.
38 39 40 |
# File 'lib/ronflex.rb', line 38 def stop_pokeflute configuration.enable = true end |