Class: YouTrack::Parser::StateBundleParser

Inherits:
Base
  • Object
show all
Defined in:
lib/you_track/parser/state_bundle_parser.rb

Instance Attribute Summary

Attributes inherited from Base

#raw

Instance Method Summary collapse

Methods inherited from Base

#initialize, #parse_fields

Constructor Details

This class inherits a constructor from YouTrack::Parser::Base

Instance Method Details

#parseObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/you_track/parser/state_bundle_parser.rb', line 2

def parse
  bundle = raw["stateBundle"]

  states = bundle.delete("state")

  bundle["states"] = states.inject([]) { |r,h|
    r << {
      "resolved" => h["isResolved"],
      "value"    => h["__content__"],
    }
  }

  bundle
end