Class: YouTrack::Parser::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (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