Class: EnergyPlus::ResultsLog
- Inherits:
-
Object
- Object
- EnergyPlus::ResultsLog
- Defined in:
- lib/energyplus/ResultsLog.rb
Instance Method Summary collapse
- #entries ⇒ Object
- #find_entries(*search_terms) ⇒ Object
- #find_entry(*search_terms) ⇒ Object
-
#initialize(path) ⇒ ResultsLog
constructor
A new instance of ResultsLog.
- #valid? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ ResultsLog
Returns a new instance of ResultsLog.
25 26 27 28 29 30 |
# File 'lib/energyplus/ResultsLog.rb', line 25 def initialize(path) @path = Pathname.new(path) @entries = [] @initialized = false @valid = false end |
Instance Method Details
#entries ⇒ Object
50 51 52 53 |
# File 'lib/energyplus/ResultsLog.rb', line 50 def entries init if not @initialized return @entries end |
#find_entries(*search_terms) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/energyplus/ResultsLog.rb', line 32 def find_entries(*search_terms) init if not @initialized entries = @entries.select do |entry| found = true search_terms.each do |search_term| if not entry[:description] =~ Regexp.new(search_term) found = false end end found end return entries end |
#find_entry(*search_terms) ⇒ Object
46 47 48 |
# File 'lib/energyplus/ResultsLog.rb', line 46 def find_entry(*search_terms) return find_entries(*search_terms).first end |
#valid? ⇒ Boolean
55 56 57 58 |
# File 'lib/energyplus/ResultsLog.rb', line 55 def valid? init if not @initialized return @valid end |