Class: MetaProject::Tracker::Jira::JiraTracker::Session

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

Overview

This wrapper around XMLRPC::Client that allows simpler method calls via method_missing and doesn’t require to manage the token

Instance Method Summary collapse

Constructor Details

#initialize(client, token) ⇒ Session

Returns a new instance of Session.



136
137
138
# File 'lib/meta_project/tracker/jira/jira_tracker.rb', line 136

def initialize(client, token)
  @client, @token = client, token
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



140
141
142
143
144
# File 'lib/meta_project/tracker/jira/jira_tracker.rb', line 140

def method_missing(sym, *args, &block)
  token_args = [@token] + args
  xmlrpc_method = "#{JIRA_API}.#{sym.to_s}"
  @client.call(xmlrpc_method, *token_args)
end