Class: Services

Inherits:
Object
  • Object
show all
Defined in:
lib/jirarest2/services.rb

Overview

Trying to keep the services together in one class so I don’t have to write so much

Direct Known Subclasses

Comment, IssueLink, IssueLinkType, Watcher

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Services



24
25
26
27
28
# File 'lib/jirarest2/services.rb', line 24

def initialize(connection)
  @connection = connection
# to be set in each subclass;
#    @uritail = ""
end

Instance Method Details

#delete(data = "") ⇒ Result

Send the DELETE request



48
49
50
# File 'lib/jirarest2/services.rb', line 48

def delete(data = "")
  return @connection.execute("Delete",@uritail,data)
end

#get(data = "") ⇒ Hash

Send the GET request



33
34
35
# File 'lib/jirarest2/services.rb', line 33

def get(data = "")
  return @connection.execute("Get",@uritail,data).result
end

#post(data = "") ⇒ Result

Send the POST request



41
42
43
# File 'lib/jirarest2/services.rb', line 41

def post(data = "")
  return @connection.execute("Post",@uritail,data)
end

#put(data = "") ⇒ Hash

Send the PUT request



55
56
57
# File 'lib/jirarest2/services.rb', line 55

def put(data = "")
  return @connection.execute("Put",@uritail,data).result
end