Class: CSVPlusPlus::Entities::String
- Extended by:
- T::Sig
- Defined in:
- lib/csv_plus_plus/entities/string.rb
Overview
A string value
Instance Attribute Summary collapse
-
#value ⇒ String
readonly
The current value of value.
Instance Method Summary collapse
- #==(other) ⇒ T::Boolean
- #evaluate(_position) ⇒ ::String
-
#initialize(value) ⇒ String
constructor
A new instance of String.
Constructor Details
#initialize(value) ⇒ String
Returns a new instance of String.
17 18 19 20 21 |
# File 'lib/csv_plus_plus/entities/string.rb', line 17 def initialize(value) super() @value = ::T.let(value.gsub(/^"|"$/, ''), ::String) end |
Instance Attribute Details
#value ⇒ String (readonly)
Returns the current value of value.
9 10 11 |
# File 'lib/csv_plus_plus/entities/string.rb', line 9 def value @value end |
Instance Method Details
#==(other) ⇒ T::Boolean
35 36 37 38 39 40 41 42 |
# File 'lib/csv_plus_plus/entities/string.rb', line 35 def ==(other) case other when self.class @value == other.value else false end end |
#evaluate(_position) ⇒ ::String
27 28 29 |
# File 'lib/csv_plus_plus/entities/string.rb', line 27 def evaluate(_position) "\"#{@value}\"" end |