Class: Animal::Classifier
- Inherits:
-
Object
- Object
- Animal::Classifier
- Defined in:
- lib/animal/classifier.rb
Overview
The class responsible for actually classifying a node The Classifier pulls together required plugins and config
Instance Method Summary collapse
- #classes ⇒ Object
- #classify(type) ⇒ Object
- #environment ⇒ Object
-
#initialize(node_name) ⇒ Classifier
constructor
A new instance of Classifier.
- #parameters ⇒ Object
Constructor Details
#initialize(node_name) ⇒ Classifier
Returns a new instance of Classifier.
5 6 7 |
# File 'lib/animal/classifier.rb', line 5 def initialize(node_name) @node_name = node_name end |
Instance Method Details
#classes ⇒ Object
9 10 11 |
# File 'lib/animal/classifier.rb', line 9 def classes classify('classes') end |
#classify(type) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/animal/classifier.rb', line 21 def classify(type) case type when 'environment' # TODO: look this up in a configuration somewhere 'production' when 'classes' Rule.apply_all_for(@node_name) when 'parameters' nil else raise 'Not Implemented' end end |
#environment ⇒ Object
17 18 19 |
# File 'lib/animal/classifier.rb', line 17 def environment classify('environment') end |
#parameters ⇒ Object
13 14 15 |
# File 'lib/animal/classifier.rb', line 13 def parameters classify('parameters') end |