Class: Smoke::CSV

Inherits:
Origin show all
Defined in:
lib/smoke/source/csv.rb

Overview

Usage:

Smoke.csv(:asx_listed_companies) do
  url "http://www.asx.com.au/asx/research/ASXListedCompanies.csv", :header_row => 3
end

Instance Attribute Summary collapse

Attributes inherited from Origin

#exposed, #items, #name, #requirements

Instance Method Summary collapse

Methods inherited from Origin

#conceal, #concealed?, #discard, #emit, #expose, #exposed?, #initialize, #insert, #keep, #method_missing, #output, #path, #prepare, #rename, #reverse, #sort, #transform, #truncate

Constructor Details

This class inherits a constructor from Smoke::Origin

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Smoke::Origin

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



9
10
11
# File 'lib/smoke/source/csv.rb', line 9

def request
  @request
end

Instance Method Details

#url(source_url, options = {}) ⇒ Object

The URL that you’d like smoke to source its data from You can also set the type for silly servers that don’t set a correct content-type (Flickr!) Example:

url "http://site.com/resource.json", :type => :json


15
16
17
# File 'lib/smoke/source/csv.rb', line 15

def url(source_url, options = {})
  @url, @options = source_url, options
end