Class: Drone::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/drone/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote: nil, host: nil, owner: nil, name: nil, url: nil, clone_url: nil, git_url: nil, ssh_url: nil, active: nil, private: nil, privileged: nil, post_commits: nil, pull_requests: nil, timeout: nil, created_at: nil, updated_at: nil) ⇒ Repository

Returns a new instance of Repository.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/drone/repository.rb', line 5

def initialize(
    remote: nil, host: nil, owner: nil, name: nil,
    url: nil, clone_url: nil, git_url: nil, ssh_url: nil,
    active: nil, private: nil, privileged: nil, post_commits: nil, pull_requests: nil,
    timeout: nil, created_at: nil, updated_at: nil)
  @remote        = remote
  @host          = host
  @owner         = owner
  @name          = name
  @url           = url
  @clone_url     = clone_url
  @git_url       = git_url
  @ssh_url       = ssh_url
  @active        = active
  @private       = private
  @privileged    = privileged
  @post_commits  = post_commits
  @pull_requests = pull_requests
  @timeout       = timeout
  @created_at    = created_at
  @updated_at    = updated_at
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



3
4
5
# File 'lib/drone/repository.rb', line 3

def active
  @active
end

#clone_urlObject (readonly)

Returns the value of attribute clone_url.



3
4
5
# File 'lib/drone/repository.rb', line 3

def clone_url
  @clone_url
end

#created_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/drone/repository.rb', line 3

def created_at
  @created_at
end

#git_urlObject (readonly)

Returns the value of attribute git_url.



3
4
5
# File 'lib/drone/repository.rb', line 3

def git_url
  @git_url
end

#hostObject (readonly)

Returns the value of attribute host.



3
4
5
# File 'lib/drone/repository.rb', line 3

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/drone/repository.rb', line 3

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



3
4
5
# File 'lib/drone/repository.rb', line 3

def owner
  @owner
end

#post_commitsObject (readonly)

Returns the value of attribute post_commits.



3
4
5
# File 'lib/drone/repository.rb', line 3

def post_commits
  @post_commits
end

#privateObject (readonly)

Returns the value of attribute private.



3
4
5
# File 'lib/drone/repository.rb', line 3

def private
  @private
end

#privilegedObject (readonly)

Returns the value of attribute privileged.



3
4
5
# File 'lib/drone/repository.rb', line 3

def privileged
  @privileged
end

#pull_requestsObject (readonly)

Returns the value of attribute pull_requests.



3
4
5
# File 'lib/drone/repository.rb', line 3

def pull_requests
  @pull_requests
end

#remoteObject (readonly)

Returns the value of attribute remote.



3
4
5
# File 'lib/drone/repository.rb', line 3

def remote
  @remote
end

#ssh_urlObject (readonly)

Returns the value of attribute ssh_url.



3
4
5
# File 'lib/drone/repository.rb', line 3

def ssh_url
  @ssh_url
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/drone/repository.rb', line 3

def timeout
  @timeout
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



3
4
5
# File 'lib/drone/repository.rb', line 3

def updated_at
  @updated_at
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/drone/repository.rb', line 3

def url
  @url
end

Class Method Details

.build_with_hash(hash) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/drone/repository.rb', line 32

def self.build_with_hash(hash)
  Repository.new(
    remote:         hash["remote"],
    host:           hash["host"],
    owner:          hash["owner"],
    name:           hash["name"],
    url:            hash["url"],
    clone_url:      hash["clone_url"],
    git_url:        hash["git_url"],
    ssh_url:        hash["ssh_url"],
    active:         hash["active"],
    private:        hash["private"],
    privileged:     hash["privileged"],
    post_commits:   hash["post_commits"],
    pull_requests:  hash["pull_requests"],
    timeout:        hash["timeout"],
    created_at:     hash["created_at"],
    updated_at:     hash["updated_at"]
  )
end

Instance Method Details

#pathObject



28
29
30
# File 'lib/drone/repository.rb', line 28

def path
  [@host, @owner, @name].join("/")
end