Class: SnapCi::Parser
- Inherits:
-
Object
- Object
- SnapCi::Parser
- Includes:
- Translations
- Defined in:
- lib/snap_ci/parser.rb
Constant Summary collapse
- ERROR_PARAMETERS =
{ 'result' => t('parser.error', { locale: :en }), 'stages' => nil }
Instance Method Summary collapse
-
#initialize(response) ⇒ Parser
constructor
A new instance of Parser.
- #to_parameters ⇒ Object
Methods included from Translations
Constructor Details
#initialize(response) ⇒ Parser
Returns a new instance of Parser.
13 14 15 |
# File 'lib/snap_ci/parser.rb', line 13 def initialize(response) set_pipeline(MultiJson.load(response.body)) end |
Instance Method Details
#to_parameters ⇒ Object
17 18 19 20 21 22 |
# File 'lib/snap_ci/parser.rb', line 17 def to_parameters { status: @pipeline['result'], steps: @pipeline['stages'] } end |