Class: AnixeCsv::Formatter::Field
- Inherits:
-
Object
- Object
- AnixeCsv::Formatter::Field
- Defined in:
- lib/anixe_csv/formatter.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#regexp ⇒ Object
Returns the value of attribute regexp.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Field
constructor
A new instance of Field.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Field
Returns a new instance of Field.
161 162 163 164 |
# File 'lib/anixe_csv/formatter.rb', line 161 def initialize(*args) @name = args[0] @value = @default = args[1] unless args[1].nil? end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
159 160 161 |
# File 'lib/anixe_csv/formatter.rb', line 159 def block @block end |
#default ⇒ Object
Returns the value of attribute default.
159 160 161 |
# File 'lib/anixe_csv/formatter.rb', line 159 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
159 160 161 |
# File 'lib/anixe_csv/formatter.rb', line 159 def name @name end |
#regexp ⇒ Object
Returns the value of attribute regexp.
159 160 161 |
# File 'lib/anixe_csv/formatter.rb', line 159 def regexp @regexp end |
#value ⇒ Object
Returns the value of attribute value.
159 160 161 |
# File 'lib/anixe_csv/formatter.rb', line 159 def value @value end |
Instance Method Details
#to_s ⇒ Object
166 167 168 169 170 171 172 |
# File 'lib/anixe_csv/formatter.rb', line 166 def to_s unless block.nil? block.call(self.value, self) else value end end |