Class: FightCSV::Schema
- Inherits:
-
Object
- Object
- FightCSV::Schema
- Defined in:
- lib/fight_csv/schema.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
- #field(fieldname, constructor_hash = {}) ⇒ Object
-
#initialize(filename = nil, &block) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(filename = nil, &block) ⇒ Schema
Returns a new instance of Schema.
4 5 6 7 8 9 10 11 |
# File 'lib/fight_csv/schema.rb', line 4 def initialize(filename = nil, &block) self.fields = Array.new if String === filename self.instance_eval { eval(File.read(filename)) } elsif block self.instance_eval &block end end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
3 4 5 |
# File 'lib/fight_csv/schema.rb', line 3 def fields @fields end |