Class: Ethel::Source
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
24 25 26 |
# File 'lib/ethel/source.rb', line 24 def all to_a end |
#each ⇒ Object
9 10 11 |
# File 'lib/ethel/source.rb', line 9 def each raise NotImplementedError end |
#field_names ⇒ Object
13 14 15 |
# File 'lib/ethel/source.rb', line 13 def field_names schema.collect(&:first) end |
#fields ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ethel/source.rb', line 17 def fields @fields ||= schema.inject({}) do |hash, (name, )| hash[name] = Field.new(name, ) hash end end |
#schema ⇒ Object
5 6 7 |
# File 'lib/ethel/source.rb', line 5 def schema raise NotImplementedError end |