Class: Rage::Router::Strategies::Host
- Inherits:
-
Object
- Object
- Rage::Router::Strategies::Host
- Defined in:
- lib/rage/router/strategies/host.rb
Defined Under Namespace
Classes: HostStorage
Instance Attribute Summary collapse
-
#must_match_when_derived ⇒ Object
readonly
Returns the value of attribute must_match_when_derived.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #custom? ⇒ Boolean
-
#initialize ⇒ Host
constructor
A new instance of Host.
- #storage ⇒ Object
- #validate(value) ⇒ Object
Constructor Details
#initialize ⇒ Host
Returns a new instance of Host.
6 7 8 9 |
# File 'lib/rage/router/strategies/host.rb', line 6 def initialize @name = "host" @must_match_when_derived = false end |
Instance Attribute Details
#must_match_when_derived ⇒ Object (readonly)
Returns the value of attribute must_match_when_derived.
4 5 6 |
# File 'lib/rage/router/strategies/host.rb', line 4 def must_match_when_derived @must_match_when_derived end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rage/router/strategies/host.rb', line 4 def name @name end |
Instance Method Details
#custom? ⇒ Boolean
15 16 17 |
# File 'lib/rage/router/strategies/host.rb', line 15 def custom? false end |
#storage ⇒ Object
11 12 13 |
# File 'lib/rage/router/strategies/host.rb', line 11 def storage HostStorage.new end |
#validate(value) ⇒ Object
19 20 21 22 23 |
# File 'lib/rage/router/strategies/host.rb', line 19 def validate(value) if !value.is_a?(String) && !value.is_a?(Regexp) raise ArgumentError, "Host should be a string or a Regexp" end end |