lib/quandl/format/dataset/attributes.rb in quandl_format-0.2.3 vs lib/quandl/format/dataset/attributes.rb in quandl_format-0.2.4
- old
+ new
@@ -6,11 +6,11 @@
extend ActiveSupport::Concern
module ClassMethods
- META_ATTRIBUTES = :source_code, :code, :name, :description, :private, :reference_url
+ META_ATTRIBUTES = :source_code, :code, :name, :description, :private, :reference_url, :frequency
DATA_ATTRIBUTES = :column_names, :data
def attribute_names
@attribute_names ||= meta_attribute_names + data_attribute_names
end
@@ -57,9 +57,10 @@
def description=(value)
@description = value.to_s.gsub('\n', "\n")
end
def data=(rows)
+ rows = rows.to_table if rows.respond_to?(:to_table)
@data = Quandl::Data.new(rows).to_date
self.column_names = @data.headers if @data.headers.present?
data_row_count_should_match_column_count!
data_rows_should_have_equal_columns!
@data
\ No newline at end of file