Class: Bonobot::Overload
- Inherits:
-
Object
- Object
- Bonobot::Overload
- Defined in:
- lib/bonobot/overload.rb
Instance Attribute Summary collapse
-
#engine_file ⇒ Object
readonly
Returns the value of attribute engine_file.
Instance Method Summary collapse
-
#initialize(local_file, engine_file) ⇒ Overload
constructor
A new instance of Overload.
- #path ⇒ Object
- #status ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(local_file, engine_file) ⇒ Overload
Returns a new instance of Overload.
7 8 9 10 |
# File 'lib/bonobot/overload.rb', line 7 def initialize(local_file, engine_file) @local_file = local_file @engine_file = engine_file end |
Instance Attribute Details
#engine_file ⇒ Object (readonly)
Returns the value of attribute engine_file.
5 6 7 |
# File 'lib/bonobot/overload.rb', line 5 def engine_file @engine_file end |
Instance Method Details
#path ⇒ Object
12 13 14 |
# File 'lib/bonobot/overload.rb', line 12 def path @local_file.path end |
#status ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/bonobot/overload.rb', line 16 def status return :unused if @engine_file.nil? return :missing if @local_file.annotation.nil? return :up_to_date if @local_file.annotation == @engine_file.fingerprint :out_of_date end |
#to_hash ⇒ Object
24 25 26 |
# File 'lib/bonobot/overload.rb', line 24 def to_hash instance_values.merge({ "status" => status, "path" => path }) end |