Class: Typedcsv
- Inherits:
-
Object
- Object
- Typedcsv
- Defined in:
- lib/typedcsv.rb,
lib/typedcsv/version.rb
Defined Under Namespace
Classes: Headers
Constant Summary collapse
- VERSION =
'1.0.0'
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#blk ⇒ Object
readonly
Returns the value of attribute blk.
Class Method Summary collapse
Instance Method Summary collapse
- #foreach_array ⇒ Object
- #foreach_hash ⇒ Object
-
#initialize(*args, &blk) ⇒ Typedcsv
constructor
A new instance of Typedcsv.
Constructor Details
#initialize(*args, &blk) ⇒ Typedcsv
Returns a new instance of Typedcsv.
20 21 22 23 |
# File 'lib/typedcsv.rb', line 20 def initialize(*args, &blk) @args = args @blk = blk end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
17 18 19 |
# File 'lib/typedcsv.rb', line 17 def args @args end |
#blk ⇒ Object (readonly)
Returns the value of attribute blk.
18 19 20 |
# File 'lib/typedcsv.rb', line 18 def blk @blk end |
Class Method Details
.foreach(*args, &blk) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/typedcsv.rb', line 8 def Typedcsv.foreach(*args, &blk) typedcsv = new(*args, &blk) if args.last.is_a?(Hash) and args.last[:headers] typedcsv.foreach_hash else typedcsv.foreach_array end end |