Class: Phenotype::HeaderStrategy
- Inherits:
-
Object
- Object
- Phenotype::HeaderStrategy
- Defined in:
- lib/phenotype/strategies/header_strategy.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#initialize(header: 'Sue') ⇒ HeaderStrategy
constructor
A new instance of HeaderStrategy.
- #version(env) ⇒ Object
Constructor Details
#initialize(header: 'Sue') ⇒ HeaderStrategy
Returns a new instance of HeaderStrategy.
7 8 9 |
# File 'lib/phenotype/strategies/header_strategy.rb', line 7 def initialize(header: 'Sue') @header = header end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
5 6 7 |
# File 'lib/phenotype/strategies/header_strategy.rb', line 5 def header @header end |
Instance Method Details
#version(env) ⇒ Object
11 12 13 |
# File 'lib/phenotype/strategies/header_strategy.rb', line 11 def version(env) env["HTTP_#{header.upcase}"] || NullStrategy.new end |