Class: WhatToDo::FacetAnalyzer
- Inherits:
-
Object
- Object
- WhatToDo::FacetAnalyzer
- Defined in:
- lib/whatToDo/facet_analyzer.rb
Instance Attribute Summary collapse
-
#facets ⇒ Object
readonly
Returns the value of attribute facets.
Instance Method Summary collapse
- #facet(facets) ⇒ Object
-
#initialize ⇒ FacetAnalyzer
constructor
A new instance of FacetAnalyzer.
Constructor Details
#initialize ⇒ FacetAnalyzer
Returns a new instance of FacetAnalyzer.
5 6 7 8 9 10 11 12 13 |
# File 'lib/whatToDo/facet_analyzer.rb', line 5 def initialize @facets = [] # Require all facet scripts dir = Pathname.new(File.dirname(__FILE__) + '/facet').cleanpath Dir["#{dir}/*.rb"].each do |file| instance_eval(File.open(File.(file)).read) end end |
Instance Attribute Details
#facets ⇒ Object (readonly)
Returns the value of attribute facets.
3 4 5 |
# File 'lib/whatToDo/facet_analyzer.rb', line 3 def facets @facets end |
Instance Method Details
#facet(facets) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/whatToDo/facet_analyzer.rb', line 15 def facet(facets) unless facets.is_a?(Array) facets = [facets] end @facets += facets if yield @facets.flatten end |