Sha256: c1c14e1f2dbb215fb4c9a7b09d75475a05034d89eb16a570a4546f9243781e2e

Contents?: true

Size: 660 Bytes

Versions: 7

Compression:

Stored size: 660 Bytes

Contents

module Quandl
class Data
module Attributes
  
  extend ActiveSupport::Concern
  
  def initialize(*args)
    self.pristine_data = args.first
    self.attributes = args.extract_options!
  end
  
  def headers=(value)
    @headers = value.flatten if value.kind_of?(Array)
  end
  def headers
    ensure_data_is_cleaned
    @headers
  end
  def headers?
    headers.present?
  end
  
  def attributes
    @attributes ||= {}
  end
  def attributes=(attrs)
    assign_attributes(attrs)
    attributes
  end
  def assign_attributes(attrs)
    attrs.each do |name, value|
      self.send("#{name}=", value) if self.respond_to?("#{name}=")
    end
  end
  
end
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
quandl_data-1.3.9 lib/quandl/data/attributes.rb
quandl_data-1.3.8 lib/quandl/data/attributes.rb
quandl_data-1.3.7 lib/quandl/data/attributes.rb
quandl_data-1.3.6 lib/quandl/data/attributes.rb
quandl_data-1.3.5 lib/quandl/data/attributes.rb
quandl_data-1.3.4 lib/quandl/data/attributes.rb
quandl_data-1.3.3 lib/quandl/data/attributes.rb