Class: FluidCLI::Theme::Syncer::Operation
- Inherits:
-
Object
- Object
- FluidCLI::Theme::Syncer::Operation
- Defined in:
- lib/fluid_cli/theme/syncer/operation.rb
Constant Summary collapse
- COLOR_BY_STATUS =
{ error: :red, synced: :green, warning: :yellow, fixed: :cyan, }
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#method ⇒ Object
Returns the value of attribute method.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #as_error_message ⇒ Object
- #as_fix_message ⇒ Object
- #as_synced_message(color: :green) ⇒ Object
- #file_path ⇒ Object
-
#initialize(ctx, method, file, options = {}) ⇒ Operation
constructor
A new instance of Operation.
- #to_s ⇒ Object
Constructor Details
#initialize(ctx, method, file, options = {}) ⇒ Operation
Returns a new instance of Operation.
16 17 18 19 20 21 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 16 def initialize(ctx, method, file, = {}) @ctx = ctx @method = method @file = file @options = end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 7 def file @file end |
#method ⇒ Object
Returns the value of attribute method.
7 8 9 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 7 def method @method end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 7 def @options end |
Instance Method Details
#as_error_message ⇒ Object
27 28 29 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 27 def (status: :error) end |
#as_fix_message ⇒ Object
35 36 37 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 35 def (status: :fixed) end |
#as_synced_message(color: :green) ⇒ Object
31 32 33 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 31 def (color: :green) (status: :synced, color: color) end |
#file_path ⇒ Object
39 40 41 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 39 def file_path file&.relative_path end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/fluid_cli/theme/syncer/operation.rb', line 23 def to_s "#{method} #{file_path}" end |