Class: Dat::Analysis::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/dat/analysis/result.rb

Overview

Public: Base class for wrappers around science mismatch results.

Instance methods defined on subclasses will be added as instance methods on science mismatch results handled by Dat::Analysis instances which add the wrapper subclass via Dat::Analysis#add or Dat::Analysis#load_classes.

Defined Under Namespace

Modules: DefaultMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Result

Public: create a new Result wrapper.

result - a science mismatch result, to be wrapped with our instance methods.



37
38
39
# File 'lib/dat/analysis/result.rb', line 37

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Public: return the current science mismatch result



12
13
14
# File 'lib/dat/analysis/result.rb', line 12

def result
  @result
end

Class Method Details

.add_to_analyzer(analyzer) ⇒ Object

Internal: Add this class to a Dat::Analysis instance. Intended to be

called from Dat::Analysis to dispatch registration.

analyzer - a Dat::Analysis instance for an experiment

Returns the analyzer’s updated list of known result wrapper classes.



30
31
32
# File 'lib/dat/analysis/result.rb', line 30

def self.add_to_analyzer(analyzer)
  analyzer.add_wrapper self
end

.inherited(subclass) ⇒ Object

Internal: Called at subclass instantiation time to register the subclass

with Dat::Analysis::Library.

subclass - The Dat::Analysis::Result subclass being instantiated.

Not intended to be called directly.



20
21
22
# File 'lib/dat/analysis/result.rb', line 20

def self.inherited(subclass)
  Dat::Analysis::Library.add subclass
end