Sha256: 5b98b8c25697aa1ecb967da6fc903ba2bb61ac8a25982b2d74f5f0d792bfd61b

Contents?: true

Size: 750 Bytes

Versions: 15

Compression:

Stored size: 750 Bytes

Contents

require 'quandl/cassinatra/model/dataset/searchable'

module Quandl
module Cassinatra
module Model

class Dataset
  
  include Concerns::Properties
  include Searchable

  attributes :id, :column_ids, :data

  delegate :columns_count, :created_at, :frequency, :rows_count, :type, :updated_at, to: :dataset_attribute

  def data_table
    Data::Table.new( self.data || [] )
  end
  def data_table=(value)
    self.data = Data::Table.new(value).to_csv
  end

  def dataset_attribute(*args)
    return @dataset_attribute if @dataset_attribute
    # options
    options = args.extract_options!
    count = options[:count] == true
    # grab dataset_attribute
    @dataset_attribute = DatasetAttribute.where( count: count ).find(id)
  end

end
end
end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
quandl_cassinatra-0.1.7 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.6 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.5 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.4 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.3 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.2 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.1.0 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.15 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.14 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.13 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.12 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.11 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.10 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.9 lib/quandl/cassinatra/model/dataset.rb
quandl_cassinatra-0.0.8 lib/quandl/cassinatra/model/dataset.rb