module Teambition2::API::Tag
Public Instance Methods
create_tag(project_id, tag)
click to toggle source
# File lib/teambition2/api/tag.rb, line 12 def create_tag(project_id, tag) post('/api/tags', { 'name' => tag, '_projectId' => project_id }) end
tag(tag_id)
click to toggle source
# File lib/teambition2/api/tag.rb, line 8 def tag(tag_id) get("/api/tags/#{tag_id}") end
tag_search(type, id, name, limit: 1)
click to toggle source
# File lib/teambition2/api/tag.rb, line 19 def tag_search(type, id, name, limit: 1) result = tags(type, id).select { |p| p['name'].include?(name) } return nil if result.empty? case limit when 0 result when 1 result[0] else result.size >= limit ? result[0..limit] : result end end