Class: Jira::StoryMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/jira.rb

Instance Method Summary collapse

Constructor Details

#initializeStoryMapper

Returns a new instance of StoryMapper.



106
107
108
# File 'lib/jira.rb', line 106

def initialize
  @map = default_mapping
end

Instance Method Details

#configure!(config) ⇒ Object



110
111
112
113
114
115
# File 'lib/jira.rb', line 110

def configure!(config)
  config[:mappings].each do |mapping|
    field, map = mapping
    @map[field] = map.to_hash
  end
end

#map(story) ⇒ Object



117
118
119
120
121
122
123
# File 'lib/jira.rb', line 117

def map(story)
  fields = story.to_hash.inject({}) do |hash, (key, value)|
    hash.merge!(do_map(key, value))
    hash
  end
  {:fields => fields}
end