lib/clomp/result.rb in clomp-0.0.4 vs lib/clomp/result.rb in clomp-0.0.5
- old
+ new
@@ -1,16 +1,23 @@
module Clomp
class Result
attr_reader :options, :operation, :state
def initialize(options: {}, tracks: [], operation: nil)
- @report = {}
-
+ @report = {}
@operation = set_prop :operation, operation || Operation.new
@tracks = set_prop :tracks, tracks || []
@options ||= {}
@immutable_data = set_prop :options, options
- @state = ->(tracks) { tracks.select {|track| track.failure?}.count.zero? }
+ @state = ->(tracks) {tracks.select {|track| track.failure?}.count.zero?}
+ end
+
+ def data
+ options[:mutable_data]
+ end
+
+ def immutable_data
+ options[:immutable_data]
end
def success?
@state.(self[:tracks]) === true
end
\ No newline at end of file