Class: GitlabRuby::QueryChain
- Inherits:
-
Object
- Object
- GitlabRuby::QueryChain
- Defined in:
- lib/gitlab_ruby/query_chain.rb
Instance Attribute Summary collapse
-
#urlstring ⇒ Object
Returns the value of attribute urlstring.
-
#verb ⇒ Object
Returns the value of attribute verb.
Class Method Summary collapse
Instance Method Summary collapse
- #execute(params = {}) ⇒ Object
-
#initialize(params = {}) ⇒ QueryChain
constructor
A new instance of QueryChain.
Constructor Details
#initialize(params = {}) ⇒ QueryChain
Returns a new instance of QueryChain.
6 7 8 9 10 |
# File 'lib/gitlab_ruby/query_chain.rb', line 6 def initialize(params = {}) @verb = params[:verb] @client = params[:client] @urlstring = '' end |
Instance Attribute Details
#urlstring ⇒ Object
Returns the value of attribute urlstring.
3 4 5 |
# File 'lib/gitlab_ruby/query_chain.rb', line 3 def urlstring @urlstring end |
#verb ⇒ Object
Returns the value of attribute verb.
4 5 6 |
# File 'lib/gitlab_ruby/query_chain.rb', line 4 def verb @verb end |
Class Method Details
.generate_methods ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab_ruby/query_chain.rb', line 17 def generate_methods CSV.foreach('lib/gitlab_ruby/routes_table_no_verb.csv') do |url_row| query_stacks = GitlabRuby::Helpers::QueryChain .to_query_stacks(url_row.first) query_stacks.each_with_index do |key| key = key.match(/{(.+)}/)[1] if key.match(/{.+}/) build_method(key) end end end |
Instance Method Details
#execute(params = {}) ⇒ Object
12 13 14 |
# File 'lib/gitlab_ruby/query_chain.rb', line 12 def execute(params = {}) @client.api_call(@urlstring, params, @verb) end |