Class: Gitlab::Kubernetes::Helm::Parsers::ListV2

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/kubernetes/helm/parsers/list_v2.rb

Overview

Parses Helm v2 list (JSON) output

Constant Summary collapse

ParserError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ ListV2

Returns a new instance of ListV2.


13
14
15
16
17
18
# File 'lib/gitlab/kubernetes/helm/parsers/list_v2.rb', line 13

def initialize(contents)
  @contents = contents
  @json = Gitlab::Json.parse(contents)
rescue JSON::ParserError => e
  raise ParserError, e.message
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents


11
12
13
# File 'lib/gitlab/kubernetes/helm/parsers/list_v2.rb', line 11

def contents
  @contents
end

#jsonObject (readonly)

Returns the value of attribute json


11
12
13
# File 'lib/gitlab/kubernetes/helm/parsers/list_v2.rb', line 11

def json
  @json
end

Instance Method Details

#releasesObject


20
21
22
# File 'lib/gitlab/kubernetes/helm/parsers/list_v2.rb', line 20

def releases
  @releases = helm_releases
end