Class: PolishInvoicer::Validator
- Inherits:
-
Object
- Object
- PolishInvoicer::Validator
- Defined in:
- lib/polish_invoicer/validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(invoice) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(invoice) ⇒ Validator
7 8 9 10 |
# File 'lib/polish_invoicer/validator.rb', line 7 def initialize(invoice) @invoice = invoice @errors = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/polish_invoicer/validator.rb', line 5 def errors @errors end |
Instance Method Details
#valid? ⇒ Boolean
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/polish_invoicer/validator.rb', line 12 def valid? @errors = {} check_presence check_not_nil check_dates check_arrays check_booleans check_price check_price_paid check_vat check_proforma check_create_and_payment_date check_currency check_lang @errors.empty? end |