Module: Quandl::Data::Enumerator
- Extended by:
- ActiveSupport::Concern
- Included in:
- Quandl::Data
- Defined in:
- lib/quandl/data/enumerator.rb
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) ⇒ Object
Instance Method Details
#assign_attributes(attrs) ⇒ Object
mass assignment protection
40 41 42 43 44 |
# File 'lib/quandl/data/enumerator.rb', line 40 def assign_attributes(attrs) attrs.each do |name, value| self.send("#{name}=", value) if self.respond_to?("#{name}=") end end |
#attributes ⇒ Object
30 31 32 |
# File 'lib/quandl/data/enumerator.rb', line 30 def attributes @attributes ||= {} end |
#attributes=(attrs) ⇒ Object
34 35 36 37 |
# File 'lib/quandl/data/enumerator.rb', line 34 def attributes=(attrs) assign_attributes(attrs) attributes end |
#data_array ⇒ Object
18 19 20 |
# File 'lib/quandl/data/enumerator.rb', line 18 def data_array @data_array ||= parse( pristine_data ) end |
#data_array=(data) ⇒ Object
22 23 24 |
# File 'lib/quandl/data/enumerator.rb', line 22 def data_array=(data) @data_array = parse(data) end |
#data_array? ⇒ Boolean
26 27 28 |
# File 'lib/quandl/data/enumerator.rb', line 26 def data_array? @data_array.present? end |
#initialize(*args) ⇒ Object
13 14 15 16 |
# File 'lib/quandl/data/enumerator.rb', line 13 def initialize(*args) self.pristine_data = args.first self.attributes = args. end |