Class: Backlog::Client

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/backlog/client.rb

Constant Summary collapse

BACKLOG_API =
"https://%s:%s@%s.backlog.jp/XML-RPC"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from API

#conv_str_to_int, #count_issue, #get_activity_types, #get_comments, #get_components, #get_custom_fields, #get_issue, #get_issue_types, #get_priorities, #get_project, #get_projects, #get_resolutions, #get_statuses, #get_timeline, #get_user, #get_user_icon, #get_users, #get_versions

Constructor Details

#initialize(space, username, password) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
# File 'lib/backlog/client.rb', line 11

def initialize(space, username, password)
  @space = space
  @username = username
  @password = password
  @client = XMLRPC::Client.new2(BACKLOG_API % [@username, @password, @space])
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



17
18
19
# File 'lib/backlog/client.rb', line 17

def client
  @client
end

#passwordObject (readonly)

Returns the value of attribute password.



17
18
19
# File 'lib/backlog/client.rb', line 17

def password
  @password
end

#spaceObject (readonly)

Returns the value of attribute space.



17
18
19
# File 'lib/backlog/client.rb', line 17

def space
  @space
end

#usernameObject (readonly)

Returns the value of attribute username.



17
18
19
# File 'lib/backlog/client.rb', line 17

def username
  @username
end

Instance Method Details

#call(method, args = nil) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/backlog/client.rb', line 19

def call(method, args=nil)
  if args
    @client.call(method, args)
  else
    @client.call(method)
  end
end