Class: OvirtSDK4::Range

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 = {}) ⇒ Range

Creates a new instance of the OvirtSDK4::Range 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):

  • :from (String)

    The value of attribute from.

  • :to (String)

    The value of attribute to.


16475
16476
16477
16478
16479
# File 'lib/ovirtsdk4/types.rb', line 16475

def initialize(opts = {})
  super(opts)
  self.from = opts[:from]
  self.to = opts[:to]
end

Instance Method Details

#==(other) ⇒ Object

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


16484
16485
16486
16487
16488
# File 'lib/ovirtsdk4/types.rb', line 16484

def ==(other)
  super &&
  @from == other.from &&
  @to == other.to
end

#fromString

Returns the value of the from attribute.

Returns:

  • (String)

16432
16433
16434
# File 'lib/ovirtsdk4/types.rb', line 16432

def from
  @from
end

#from=(value) ⇒ Object

Sets the value of the from attribute.

Parameters:

  • value (String)

16441
16442
16443
# File 'lib/ovirtsdk4/types.rb', line 16441

def from=(value)
  @from = value
end

#hashObject

Generates a hash value for this object.


16493
16494
16495
16496
16497
# File 'lib/ovirtsdk4/types.rb', line 16493

def hash
  super +
  @from.hash +
  @to.hash
end

#toString

Returns the value of the to attribute.

Returns:

  • (String)

16450
16451
16452
# File 'lib/ovirtsdk4/types.rb', line 16450

def to
  @to
end

#to=(value) ⇒ Object

Sets the value of the to attribute.

Parameters:

  • value (String)

16459
16460
16461
# File 'lib/ovirtsdk4/types.rb', line 16459

def to=(value)
  @to = value
end