Class: Early::DefaultVariable
- Inherits:
-
Object
- Object
- Early::DefaultVariable
- Defined in:
- lib/early.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(name, value) ⇒ DefaultVariable
constructor
A new instance of DefaultVariable.
Constructor Details
#initialize(name, value) ⇒ DefaultVariable
Returns a new instance of DefaultVariable.
43 44 45 46 |
# File 'lib/early.rb', line 43 def initialize(name, value) @name = String(name) @value = String(value) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/early.rb', line 41 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
41 42 43 |
# File 'lib/early.rb', line 41 def value @value end |
Instance Method Details
#apply ⇒ Object
48 49 50 |
# File 'lib/early.rb', line 48 def apply ENV[name] ||= value end |