Class: EnumItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/f5/icontrol/common/enum_item.rb

Overview

This is a helper type to encapsulate iControl enumerations in a way which easily gives us access to the member as well as the value, since the SOAP API and the Savon serializers seem to use the string version of the member name rather than the value.

Additional iControl enumerations can be generated using nimbletest.com/live with ‘t’ as a column separator and the following substitution pattern:

# $2 $0 = EnumItem.new(‘$0’, ‘$1’)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#memberObject

Returns the value of attribute member

Returns:

  • (Object)

    the current value of member



15
16
17
# File 'lib/f5/icontrol/common/enum_item.rb', line 15

def member
  @member
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



15
16
17
# File 'lib/f5/icontrol/common/enum_item.rb', line 15

def value
  @value
end

Instance Method Details

#to_iObject



20
21
22
# File 'lib/f5/icontrol/common/enum_item.rb', line 20

def to_i
  self.value
end

#to_sObject



16
17
18
# File 'lib/f5/icontrol/common/enum_item.rb', line 16

def to_s
  self.member
end