Class: Gitomator::Service::Tagging

Inherits:
BaseService show all
Defined in:
lib/gitomator/service/tagging.rb

Instance Attribute Summary

Attributes inherited from BaseService

#provider

Instance Method Summary collapse

Methods inherited from BaseService

#after_each_service_call, #before_each_service_call, #initialize, #on_service_call_error, #service_call

Constructor Details

This class inherits a constructor from Gitomator::BaseService

Instance Method Details

#add_tags(namespace, id_or_name, *tags) ⇒ Object

Add ‘tag` to object (the object with the given `id_or_name` in the given `namespace`)

Parameters:

  • namespace (String)
  • id_or_name (String/Number)
  • tags (*String)


16
17
18
# File 'lib/gitomator/service/tagging.rb', line 16

def add_tags(namespace, id_or_name, *tags)
  service_call(__callee__, namespace, id_or_name, *tags)
end

#delete_metadata(namespace, tag) ⇒ Object

Delete all metadata associated with the given tag (in the given namespace).

Parameters:

  • namespace (String)
  • tag (String)


92
93
94
# File 'lib/gitomator/service/tagging.rb', line 92

def (namespace, tag)
  service_call(__callee__, namespace, tag)
end

#metadata(namespace, tag = nil) ⇒ Hash<String,Object>

Get the metadata associated with the given tag in the given namespace. If a ‘tag` is not specified, get metadata for all tags in the namespace.

Parameters:

  • namespace (String)
  • tag (String) (defaults to: nil)

Returns:

  • (Hash<String,Object>)

    The tag’s metadata. If no tag was specified, return a Hash that maps each tag to its metadata.



68
69
70
# File 'lib/gitomator/service/tagging.rb', line 68

def (namespace, tag=nil)
  service_call(__callee__, namespace, tag)
end

#remove_tag(namespace, id_or_name, tag) ⇒ Object

Remove tag from object.

Parameters:

  • namespace (String)
  • id_or_name (String/Number)
  • tag (String)


28
29
30
# File 'lib/gitomator/service/tagging.rb', line 28

def remove_tag(namespace, id_or_name, tag)
  service_call(__callee__, namespace, id_or_name, tag)
end

#search(namespace, query) ⇒ Object

Search for objects by tag(s).

Parameters:

  • namespace (String)
  • query (String/Hash)
    • Either a single tag (String) or a query (Hash).

Returns:

  • Enumerable of object identifiers.



54
55
56
# File 'lib/gitomator/service/tagging.rb', line 54

def search(namespace, query)
  service_call(__callee__, namespace, query)
end

#set_metadata(namespace, tag, metadata) ⇒ Object

Add the given metadata to the given tag (in the given namespace). You can remove metadata properties by updating their value to nil.

Parameters:

  • namespace (String)
  • tag (String)
  • metadata (String)


81
82
83
# File 'lib/gitomator/service/tagging.rb', line 81

def (namespace, tag, )
  service_call(__callee__, namespace, tag, )
end

#tags(namespace, id_or_name) ⇒ Array<String>

Get all tags associated with the specified object.

Parameters:

  • namespace (String)
  • id_or_name (String/Number)

Returns:

  • (Array<String>)


41
42
43
# File 'lib/gitomator/service/tagging.rb', line 41

def tags(namespace, id_or_name)
  service_call(__callee__, namespace, id_or_name)
end