Class: YamlBot::CLIBot
- Inherits:
-
Object
- Object
- YamlBot::CLIBot
- Defined in:
- lib/yaml_bot/cli_bot.rb
Instance Attribute Summary collapse
-
#logger_bot ⇒ Object
Returns the value of attribute logger_bot.
-
#options ⇒ Object
Returns the value of attribute options.
-
#rules_bot ⇒ Object
Returns the value of attribute rules_bot.
-
#validation_bot ⇒ Object
Returns the value of attribute validation_bot.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CLIBot
constructor
A new instance of CLIBot.
- #run ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ CLIBot
Returns a new instance of CLIBot.
9 10 11 12 13 |
# File 'lib/yaml_bot/cli_bot.rb', line 9 def initialize(opts = {}) = opts @rules_bot = RulesBot.new @validation_bot = ValidationBot.new end |
Instance Attribute Details
#logger_bot ⇒ Object
Returns the value of attribute logger_bot.
7 8 9 |
# File 'lib/yaml_bot/cli_bot.rb', line 7 def logger_bot @logger_bot end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/yaml_bot/cli_bot.rb', line 7 def end |
#rules_bot ⇒ Object
Returns the value of attribute rules_bot.
7 8 9 |
# File 'lib/yaml_bot/cli_bot.rb', line 7 def rules_bot @rules_bot end |
#validation_bot ⇒ Object
Returns the value of attribute validation_bot.
7 8 9 |
# File 'lib/yaml_bot/cli_bot.rb', line 7 def validation_bot @validation_bot end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/yaml_bot/cli_bot.rb', line 15 def run load_rules load_yaml validate_rules scan_yaml print_results @validation_bot.violations.zero? ? 0 : 1 end |