Class: BacklogKit::Client

Inherits:
Object
  • Object
show all
Includes:
Git, Group, Issue, Notification, Priority, Resolution, Space, Star, Status, User
Defined in:
lib/backlog_kit/client.rb,
lib/backlog_kit/client/git.rb,
lib/backlog_kit/client/star.rb,
lib/backlog_kit/client/user.rb,
lib/backlog_kit/client/group.rb,
lib/backlog_kit/client/issue.rb,
lib/backlog_kit/client/space.rb,
lib/backlog_kit/client/status.rb,
lib/backlog_kit/client/priority.rb,
lib/backlog_kit/client/resolution.rb,
lib/backlog_kit/client/notification.rb

Defined Under Namespace

Modules: Git, Group, Issue, Notification, Priority, Resolution, Space, Star, Status, User

Constant Summary collapse

USER_AGENT =
"BacklogKit Ruby Gem #{BacklogKit::VERSION}".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from User

#create_user, #delete_user, #download_user_icon, #get_myself, #get_recently_viewed_issues, #get_recently_viewed_projects, #get_recently_viewed_wikis, #get_user, #get_user_activities, #get_user_star_count, #get_user_stars, #get_users, #update_user

Methods included from Status

#get_statuses

Methods included from Star

#add_issue_comment_star, #add_issue_star, #add_wiki_star

Methods included from Space

#download_space_icon, #get_space, #get_space_activities, #get_space_disk_usage, #get_space_notification, #update_space_notification, #upload_attachment

Methods included from Resolution

#get_resolutions

Methods included from Priority

#get_priorities

Methods included from Notification

#get_notification_count, #get_notifications, #mark_as_read_notification, #reset_already_read_notification_count

Methods included from Issue

#add_comment, #add_comment_notification, #create_issue, #delete_issue, #download_issue_attachment, #get_comment, #get_comment_count, #get_comment_notifications, #get_comments, #get_issue, #get_issue_attachments, #get_issue_count, #get_issue_shared_files, #get_issues, #link_issue_shared_files, #remove_issue_attachment, #unlink_issue_shared_file, #update_comment, #update_issue

Methods included from Group

#create_group, #delete_group, #get_group, #get_groups, #update_group

Methods included from Git

#get_git_repositories

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



35
36
37
38
39
40
41
42
# File 'lib/backlog_kit/client.rb', line 35

def initialize(options = {})
  @space_id = ENV['BACKLOG_SPACE_ID']
  @api_key  = ENV['BACKLOG_API_KEY']

  options.each do |key, value|
    instance_variable_set(:"@#{key}", value)
  end
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



33
34
35
# File 'lib/backlog_kit/client.rb', line 33

def api_key
  @api_key
end

#space_idObject

Returns the value of attribute space_id.



33
34
35
# File 'lib/backlog_kit/client.rb', line 33

def space_id
  @space_id
end

Instance Method Details

#delete(path, params = {}) ⇒ Object



60
61
62
# File 'lib/backlog_kit/client.rb', line 60

def delete(path, params = {})
  request(:delete, path, params)
end

#get(path, params = {}) ⇒ Object



44
45
46
# File 'lib/backlog_kit/client.rb', line 44

def get(path, params = {})
  request(:get, path, params)
end

#patch(path, params = {}) ⇒ Object



56
57
58
# File 'lib/backlog_kit/client.rb', line 56

def patch(path, params = {})
  request(:patch, path, params)
end

#post(path, params = {}) ⇒ Object



48
49
50
# File 'lib/backlog_kit/client.rb', line 48

def post(path, params = {})
  request(:post, path, params)
end

#put(path, params = {}) ⇒ Object



52
53
54
# File 'lib/backlog_kit/client.rb', line 52

def put(path, params = {})
  request(:put, path, params)
end