Class: ShopifyCLI::Theme::Syncer::StandardReporter
- Inherits:
-
Object
- Object
- ShopifyCLI::Theme::Syncer::StandardReporter
- Defined in:
- lib/shopify_cli/theme/syncer/standard_reporter.rb
Overview
ShopifyCLI::Theme::Syncer::StdReporter allows disabling/enabling messages reported in the standard error output (ShopifyCLI::Context#puts).
Instance Attribute Summary collapse
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
Instance Method Summary collapse
- #disable! ⇒ Object
- #enable! ⇒ Object
-
#initialize(ctx) ⇒ StandardReporter
constructor
A new instance of StandardReporter.
- #report(message) ⇒ Object
Constructor Details
#initialize(ctx) ⇒ StandardReporter
Returns a new instance of StandardReporter.
13 14 15 16 |
# File 'lib/shopify_cli/theme/syncer/standard_reporter.rb', line 13 def initialize(ctx) @enabled = true @ctx = ctx end |
Instance Attribute Details
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
11 12 13 |
# File 'lib/shopify_cli/theme/syncer/standard_reporter.rb', line 11 def ctx @ctx end |
Instance Method Details
#disable! ⇒ Object
18 19 20 |
# File 'lib/shopify_cli/theme/syncer/standard_reporter.rb', line 18 def disable! @enabled = false end |
#enable! ⇒ Object
22 23 24 |
# File 'lib/shopify_cli/theme/syncer/standard_reporter.rb', line 22 def enable! @enabled = true end |
#report(message) ⇒ Object
26 27 28 |
# File 'lib/shopify_cli/theme/syncer/standard_reporter.rb', line 26 def report() ctx.error() if @enabled end |