Class: CSVPlusPlus::Entities::String
- 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.
Attributes inherited from Entity
Instance Method Summary collapse
- #==(other) ⇒ boolean
-
#initialize(value) ⇒ String
constructor
A new instance of String.
- #to_s ⇒ String
Methods inherited from Entity
#method_missing, #respond_to_missing?
Constructor Details
#initialize(value) ⇒ String
Returns a new instance of String.
12 13 14 15 16 |
# File 'lib/csv_plus_plus/entities/string.rb', line 12 def initialize(value) super(:string) @value = value.gsub(/^"|"$/, '') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CSVPlusPlus::Entities::Entity
Instance Attribute Details
#value ⇒ String (readonly)
Returns the current value of value.
8 9 10 |
# File 'lib/csv_plus_plus/entities/string.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ boolean
24 25 26 |
# File 'lib/csv_plus_plus/entities/string.rb', line 24 def ==(other) super && value == other.value end |
#to_s ⇒ String
19 20 21 |
# File 'lib/csv_plus_plus/entities/string.rb', line 19 def to_s "\"#{@value}\"" end |