Class: Quandl::Data::Table
- Inherits:
-
Object
- Object
- Quandl::Data::Table
- Includes:
- Loggable, Operations
- Defined in:
- lib/quandl/data/table.rb,
lib/quandl/data/table/loggable.rb,
lib/quandl/data/table/operations.rb
Defined Under Namespace
Modules: Loggable, Operations
Instance Attribute Summary collapse
-
#pristine_data ⇒ Object
Returns the value of attribute pristine_data.
Instance Method Summary collapse
-
#assign_attributes(attrs) ⇒ Object
mass assignment protection.
- #attributes ⇒ Object
- #attributes=(attrs) ⇒ Object
- #data_array ⇒ Object
- #data_array=(data) ⇒ Object
- #data_array? ⇒ Boolean
-
#initialize(*args) ⇒ Table
constructor
A new instance of Table.
Methods included from Loggable
Methods included from Operations
#collapse, #collapse=, #frequency, #frequency=, #limit, #parse, #sort_ascending, #sort_ascending!, #sort_descending, #sort_descending!, #sort_order, #to_csv, #to_date, #to_date!, #to_h, #to_jd, #to_jd!, #transform, #transform=, #trim_end, #trim_start
Constructor Details
#initialize(*args) ⇒ Table
Returns a new instance of Table.
16 17 18 19 |
# File 'lib/quandl/data/table.rb', line 16 def initialize(*args) self.pristine_data = args.first self.attributes = args. end |
Instance Attribute Details
#pristine_data ⇒ Object
Returns the value of attribute pristine_data.
14 15 16 |
# File 'lib/quandl/data/table.rb', line 14 def pristine_data @pristine_data end |
Instance Method Details
#assign_attributes(attrs) ⇒ Object
mass assignment protection
43 44 45 46 47 |
# File 'lib/quandl/data/table.rb', line 43 def assign_attributes(attrs) attrs.each do |name, value| self.send("#{name}=", value) if self.respond_to?("#{name}=") end end |
#attributes ⇒ Object
33 34 35 |
# File 'lib/quandl/data/table.rb', line 33 def attributes @attributes ||= {} end |
#attributes=(attrs) ⇒ Object
37 38 39 40 |
# File 'lib/quandl/data/table.rb', line 37 def attributes=(attrs) assign_attributes(attrs) attributes end |
#data_array ⇒ Object
21 22 23 |
# File 'lib/quandl/data/table.rb', line 21 def data_array @data_array ||= parse( pristine_data ) end |
#data_array=(data) ⇒ Object
25 26 27 |
# File 'lib/quandl/data/table.rb', line 25 def data_array=(data) @data_array = parse(data) end |
#data_array? ⇒ Boolean
29 30 31 |
# File 'lib/quandl/data/table.rb', line 29 def data_array? @data_array.present? end |