Class: ObjectMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/base/v1/ocpapi/ObjectMeta.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObjectMeta

Returns a new instance of ObjectMeta.



31
32
33
34
35
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 31

def initialize
  @name = nil
  @namespace = nil
  @selflink = nil
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 27

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace.



28
29
30
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 28

def namespace
  @namespace
end

Returns the value of attribute selflink.



29
30
31
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 29

def selflink
  @selflink
end

Instance Method Details

#get_hashObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 37

def get_hash
  metaHash = Hash.new
  unless @name.nil?
    metaHash[:name] = @name
  end

  unless @namespace.nil?
    metaHash[:namespace] = @namespace
  end

  unless @selflink.nil?
    metaHash[:selflink] = @selflink
  end

  metaHash[:resourceVersion] = "1001"

  return metaHash
end

#get_jsonObject



56
57
58
# File 'lib/base/v1/ocpapi/ObjectMeta.rb', line 56

def get_json
  return JSON.generate(get_hash)
end