Class: TTK::Streams::Stream
- Defined in:
- lib/ttk/strategies/Streams/Stream.rb
Instance Attribute Summary collapse
-
#my ⇒ Object
Attributes.
-
#name ⇒ Object
Attributes.
-
#ref ⇒ Object
Attributes.
Instance Method Summary collapse
- #clean ⇒ Object
-
#compare_streams ⇒ Object
Methods.
-
#initialize(name, ref = nil) ⇒ Stream
constructor
Constructor.
- #status ⇒ Object
- #to_ttk_log(log) ⇒ Object
Constructor Details
#initialize(name, ref = nil) ⇒ Stream
Constructor
24 25 26 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 24 def initialize ( name, ref=nil ) @name, @my, @ref = name.to_s, TempPath.new(name), ref end |
Instance Attribute Details
#my ⇒ Object
Attributes
17 18 19 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 17 def my @my end |
#name ⇒ Object
Attributes
17 18 19 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 17 def name @name end |
#ref ⇒ Object
Attributes
17 18 19 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 17 def ref @ref end |
Instance Method Details
#clean ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 50 def clean if @my.is_a? Pathname @my.unlink if @my.exist? and @my.temp? end if @ref.is_a? Pathname @ref.unlink if @ref.exist? and @ref.temp? elsif @ref.is_a? File ref = Pathname.new(@ref.path) ref.unlink if ref.exist? and ref.temp? end end |
#compare_streams ⇒ Object
Methods
33 34 35 36 37 38 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 33 def compare_streams return @cmp if defined? @cmp @cmp = @ref.compare_stream(@my) @status = @cmp ? :PASS : :FAILED @cmp end |
#status ⇒ Object
40 41 42 43 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 40 def status compare_streams @status end |
#to_ttk_log(log) ⇒ Object
45 46 47 48 |
# File 'lib/ttk/strategies/Streams/Stream.rb', line 45 def to_ttk_log ( log ) log["my_#@name"] = @my.to_s_for_ttk_log log["ref_#@name"] = @ref.to_s_for_ttk_log unless @ref.nil? end |