Class: Hanami::Action::Cache::NonValueDirective Private
- Inherits:
-
Object
- Object
- Hanami::Action::Cache::NonValueDirective
- Defined in:
- lib/hanami/action/cache/directives.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class representing non value directives
ex: no-cache
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(name) ⇒ NonValueDirective
constructor
private
A new instance of NonValueDirective.
- #to_str ⇒ Object private
- #valid? ⇒ Boolean private
Constructor Details
#initialize(name) ⇒ NonValueDirective
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NonValueDirective.
61 62 63 |
# File 'lib/hanami/action/cache/directives.rb', line 61 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
57 58 59 |
# File 'lib/hanami/action/cache/directives.rb', line 57 def name @name end |
Instance Method Details
#to_str ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
67 68 69 |
# File 'lib/hanami/action/cache/directives.rb', line 67 def to_str @name.to_s.tr("_", "-") end |
#valid? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
73 74 75 |
# File 'lib/hanami/action/cache/directives.rb', line 73 def valid? NON_VALUE_DIRECTIVES.include? @name end |