Class: Ringo::Mingle
- Inherits:
-
Object
- Object
- Ringo::Mingle
- Defined in:
- lib/ringo/mingle.rb
Class Method Summary collapse
- .base ⇒ Object
- .config ⇒ Object
- .get(url, params = {}) ⇒ Object
- .host ⇒ Object
- .password ⇒ Object
- .project ⇒ Object
- .stories ⇒ Object
- .story(number) ⇒ Object
- .user ⇒ Object
- .wall ⇒ Object
Class Method Details
.base ⇒ Object
50 51 52 |
# File 'lib/ringo/mingle.rb', line 50 def base "https://#{host}/api/v2/projects/#{project}".to_uri(username: user, password: password) end |
.config ⇒ Object
9 10 11 |
# File 'lib/ringo/mingle.rb', line 9 def config @@config ||= YAML.load File.open('config/mingle.yml') end |
.get(url, params = {}) ⇒ Object
54 55 56 |
# File 'lib/ringo/mingle.rb', line 54 def get url, params={} Nokogiri::XML base[url].get(params).body end |
.host ⇒ Object
25 26 27 |
# File 'lib/ringo/mingle.rb', line 25 def host config['host'] end |
.password ⇒ Object
17 18 19 |
# File 'lib/ringo/mingle.rb', line 17 def password config['password'] end |
.project ⇒ Object
21 22 23 |
# File 'lib/ringo/mingle.rb', line 21 def project config['project'] end |
.stories ⇒ Object
29 30 31 32 |
# File 'lib/ringo/mingle.rb', line 29 def stories filter = {'view' => 'Story Wall'} Ringo::StoryCard.from_result get 'cards.xml', filter end |
.story(number) ⇒ Object
34 35 36 |
# File 'lib/ringo/mingle.rb', line 34 def story number Ringo::StoryCard.from_card get "cards/#{number}.xml" end |
.user ⇒ Object
13 14 15 |
# File 'lib/ringo/mingle.rb', line 13 def user config['user'] end |
.wall ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ringo/mingle.rb', line 38 def wall result = {} stories.each do |story| next unless STATUSES.include? story.status result[story.status] ||= [] result[story.status] << story end result end |