Class: Bonobot::EngineFile
- Inherits:
-
Object
- Object
- Bonobot::EngineFile
- Defined in:
- lib/bonobot/engine_file.rb
Instance Attribute Summary collapse
-
#engine_name ⇒ Object
readonly
Returns the value of attribute engine_name.
-
#fingerprint ⇒ Object
readonly
Returns the value of attribute fingerprint.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#short_path ⇒ Object
readonly
Returns the value of attribute short_path.
Instance Method Summary collapse
-
#initialize(path, engine) ⇒ EngineFile
constructor
A new instance of EngineFile.
- #to_hash ⇒ Object
Constructor Details
#initialize(path, engine) ⇒ EngineFile
Returns a new instance of EngineFile.
7 8 9 10 11 12 13 |
# File 'lib/bonobot/engine_file.rb', line 7 def initialize(path, engine) @path = path @root_path = engine.instance.root @engine_name = engine_to_name(engine) @short_path = path.sub("#{@root_path}/", "") @fingerprint = Bonobot::Fingerprint.calculate(path) end |
Instance Attribute Details
#engine_name ⇒ Object (readonly)
Returns the value of attribute engine_name.
5 6 7 |
# File 'lib/bonobot/engine_file.rb', line 5 def engine_name @engine_name end |
#fingerprint ⇒ Object (readonly)
Returns the value of attribute fingerprint.
5 6 7 |
# File 'lib/bonobot/engine_file.rb', line 5 def fingerprint @fingerprint end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/bonobot/engine_file.rb', line 5 def path @path end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
5 6 7 |
# File 'lib/bonobot/engine_file.rb', line 5 def root_path @root_path end |
#short_path ⇒ Object (readonly)
Returns the value of attribute short_path.
5 6 7 |
# File 'lib/bonobot/engine_file.rb', line 5 def short_path @short_path end |
Instance Method Details
#to_hash ⇒ Object
15 16 17 |
# File 'lib/bonobot/engine_file.rb', line 15 def to_hash instance_values.merge({ "fingerprint" => fingerprint }) end |