Sha256: 96706244e8b9115b26f2b584f3bdb9f5ee8e29d9c67803f347cf02db5368abb9

Contents?: true

Size: 723 Bytes

Versions: 12

Compression:

Stored size: 723 Bytes

Contents

module Quandl
module Client

class Source < Quandl::Client::Base
  
  ##########  
  # SCOPES #
  ##########
  
  scope :query
  scope :page, ->(p){ where( page: p.to_i )}
  scope :code, ->(c){ where( code: c.to_s.upcase )}
  
  
  ###############
  # ASSOCIATIONS #
  ###############
  
  def datasets
    Quandl::Client::Dataset.source_code(code)
  end
  
  
  ###############
  # VALIDATIONS #
  ###############
   
  validates :code, presence: true, length: { minimum: 2 }, format: { with: /([A-Z0-9_]+)/ }
  validates :host, :name, presence: true
  

  ##############
  # PROPERTIES #
  ##############
   
  attributes :code, :name, :host, :description, :datasets_count, :use_proxy, :type, :concurrency
  
end

end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
quandl_client-2.3.2 lib/quandl/client/models/source.rb
quandl_client-2.3.1 lib/quandl/client/models/source.rb
quandl_client-2.3.0 lib/quandl/client/models/source.rb
quandl_client-2.2.2 lib/quandl/client/models/source.rb
quandl_client-2.2.1 lib/quandl/client/models/source.rb
quandl_client-2.2.0 lib/quandl/client/models/source.rb
quandl_client-2.1.4 lib/quandl/client/models/source.rb
quandl_client-2.1.3 lib/quandl/client/models/source.rb
quandl_client-2.1.2 lib/quandl/client/models/source.rb
quandl_client-2.1.1 lib/quandl/client/models/source.rb
quandl_client-2.1.0 lib/quandl/client/models/source.rb
quandl_client-2.0.1 lib/quandl/client/models/source.rb