Module: Quandl::Data::Validations
- Extended by:
- ActiveSupport::Concern
- Included in:
- Quandl::Data
- Defined in:
- lib/quandl/data/validations.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#errors ⇒ Object
32 33 34 |
# File 'lib/quandl/data/validations.rb', line 32 def errors @errors ||= [] end |
#errors=(value) ⇒ Object
35 36 37 |
# File 'lib/quandl/data/validations.rb', line 35 def errors=(value) @errors = value end |
#raise_error_unless_valid! ⇒ Object
26 27 28 29 30 |
# File 'lib/quandl/data/validations.rb', line 26 def raise_error_unless_valid! self.errors = [] self.data_array = pristine_data true end |
#valid? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'lib/quandl/data/validations.rb', line 18 def valid? raise_error_unless_valid! rescue *ERROR_TYPES => error self.errors << error self.data_array = [] false end |