Skip to content

Commit 4ce9bf7

Browse files
committed
added /tags query
1 parent e38d574 commit 4ce9bf7

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

lib/ruby-stackoverflow/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
require 'ruby-stackoverflow/client/badges_helper'
2121
require 'ruby-stackoverflow/client/comments_helper'
2222
require 'ruby-stackoverflow/client/search_helper'
23+
require 'ruby-stackoverflow/client/tag_helper'
2324
require 'ruby-stackoverflow/client/parse_options'
2425

2526
module RubyStackoverflow
@@ -30,6 +31,7 @@ class Client
3031
include RubyStackoverflow::Client::BadgesHelper
3132
include RubyStackoverflow::Client::CommentsHelper
3233
include RubyStackoverflow::Client::SearchHelper
34+
include RubyStackoverflow::Client::TagHelper
3335

3436
attr_accessor :configuration
3537

lib/ruby-stackoverflow/client/resource/tag.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
module RubyStackoverflow
22
class Client
33
class Tag < Resource
4-
#def initialize(attributes_hash)
5-
#Tag.define_atribute_methods(attributes_hash)
6-
#end
7-
8-
#class << self
9-
#def define_atribute_methods(attributes_hash)
10-
#attributes_hash.each do|k,v|
11-
#define_method(k) do v; end
12-
#end
13-
#end
14-
#end
154
end
165
end
176
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module RubyStackoverflow
2+
class Client
3+
module TagHelper
4+
5+
def tags(options={})
6+
tags_response(options)
7+
end
8+
9+
private
10+
11+
def tags_response(options={})
12+
getr 'tags/', 'tag', options
13+
end
14+
15+
end
16+
end
17+
end

ruby-stackoverflow.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
1818
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
1919
spec.require_paths = ["lib"]
2020

21-
spec.add_runtime_dependency "httparty", "~> 0.11.0"
21+
spec.add_runtime_dependency "httparty", "~> 0.13.3"
2222
spec.add_runtime_dependency "json"
2323

2424
spec.add_development_dependency "rspec", "~> 2.1"

0 commit comments

Comments
 (0)