Class: YouTrack::Parser::Base
- Inherits:
-
Object
- Object
- YouTrack::Parser::Base
- Defined in:
- lib/you_track/parser/base.rb
Direct Known Subclasses
CommentsParser, IssueParser, ProjectCustomFieldsParser, ProjectsParser, StateBundleParser, UserParser
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Base
constructor
A new instance of Base.
- #parse_fields(fields) ⇒ Object
Constructor Details
#initialize(raw) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/you_track/parser/base.rb', line 4 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
2 3 4 |
# File 'lib/you_track/parser/base.rb', line 2 def raw @raw end |
Instance Method Details
#parse_fields(fields) ⇒ Object
8 9 10 |
# File 'lib/you_track/parser/base.rb', line 8 def parse_fields(fields) fields.inject({}) { |r, f| r.merge(f["name"] => f["value"]) } end |