Class: Cavalry::Client
- Inherits:
-
Object
- Object
- Cavalry::Client
- Defined in:
- lib/cavalry/client.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #done? ⇒ Boolean
- #dump ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #run ⇒ Object
Constructor Details
#initialize(config) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 |
# File 'lib/cavalry/client.rb', line 5 def initialize(config) @config = config @errors = [] config.load_models config.load_validators end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/cavalry/client.rb', line 3 def errors @errors end |
Instance Method Details
#done? ⇒ Boolean
20 21 22 |
# File 'lib/cavalry/client.rb', line 20 def done? @done end |
#dump ⇒ Object
24 25 26 |
# File 'lib/cavalry/client.rb', line 24 def dump errors.map(&:dump) end |
#run ⇒ Object
13 14 15 16 17 18 |
# File 'lib/cavalry/client.rb', line 13 def run @errors = all_validators.flat_map do |klass| klass.execute_validation end @done = true end |