Sha256: da45c1badc470a3b353948748c0a5a0388d7bdbbcdb29d4fe95bf84d74a1833a

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

module Quandl
module Cassinatra
module Model
class Dataset

module RestOrm

  extend ActiveSupport::Concern
  
  included do
    
    include Her::Model
    use_api Cassinatra.her_api
  
    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_jd.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
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
quandl_cassinatra-0.0.7 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.6 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.5 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.4 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.3 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.2 lib/quandl/cassinatra/model/dataset/rest_orm.rb
quandl_cassinatra-0.0.1 lib/quandl/cassinatra/model/dataset/rest_orm.rb