Class: OvirtSDK4::SpecialObjects

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ SpecialObjects

Creates a new instance of the OvirtSDK4::SpecialObjects class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :blank_template (Template, Hash)

    The value of attribute blank_template.

  • :root_tag (Tag, Hash)

    The value of attribute root_tag.



18859
18860
18861
18862
18863
# File 'lib/ovirtsdk4/types.rb', line 18859

def initialize(opts = {})
  super(opts)
  self.blank_template = opts[:blank_template]
  self.root_tag = opts[:root_tag]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



18868
18869
18870
18871
18872
# File 'lib/ovirtsdk4/types.rb', line 18868

def ==(other)
  super &&
  @blank_template == other.blank_template &&
  @root_tag == other.root_tag
end

#blank_templateTemplate

Returns the value of the blank_template attribute.

Returns:



18802
18803
18804
# File 'lib/ovirtsdk4/types.rb', line 18802

def blank_template
  @blank_template
end

#blank_template=(value) ⇒ Object

Sets the value of the blank_template attribute.

The value parameter can be an instance of Template or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



18815
18816
18817
18818
18819
18820
# File 'lib/ovirtsdk4/types.rb', line 18815

def blank_template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @blank_template = value
end

#hashObject

Generates a hash value for this object.



18877
18878
18879
18880
18881
# File 'lib/ovirtsdk4/types.rb', line 18877

def hash
  super +
  @blank_template.hash +
  @root_tag.hash
end

#root_tagTag

Returns the value of the root_tag attribute.

Returns:



18827
18828
18829
# File 'lib/ovirtsdk4/types.rb', line 18827

def root_tag
  @root_tag
end

#root_tag=(value) ⇒ Object

Sets the value of the root_tag attribute.

The value parameter can be an instance of Tag or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Tag, Hash)


18840
18841
18842
18843
18844
18845
# File 'lib/ovirtsdk4/types.rb', line 18840

def root_tag=(value)
  if value.is_a?(Hash)
    value = Tag.new(value)
  end
  @root_tag = value
end