Class: GitlabCli::Snippet

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_cli/snippet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, title, file_name, expires_at, updated_at, created_at, project_id, author = nil) ⇒ Snippet

Returns a new instance of Snippet.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gitlab_cli/snippet.rb', line 5

def initialize(id, title, file_name, expires_at, updated_at, created_at, project_id, author=nil)
  @id = id
  @title = title
  @file_name = file_name
  @expires_at = expires_at
  @updated_at = updated_at
  @created_at = created_at

  @project_id = project_id
  @view_url = get_view_url

  @author = author.class == 'Gitlab::User' || author.nil? ? author : parse_author(author)
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def author
  @author
end

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def created_at
  @created_at
end

#expires_atObject

Returns the value of attribute expires_at.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def expires_at
  @expires_at
end

#file_nameObject

Returns the value of attribute file_name.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def file_name
  @file_name
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def id
  @id
end

#project_idObject

Returns the value of attribute project_id.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def project_id
  @project_id
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def updated_at
  @updated_at
end

#view_urlObject

Returns the value of attribute view_url.



3
4
5
# File 'lib/gitlab_cli/snippet.rb', line 3

def view_url
  @view_url
end