Sha256: c3cbf1cfa465451efc30356653d6d8305e9ea52c4c1da72efd6af9909a6e7cc8

Contents?: true

Size: 574 Bytes

Versions: 9

Compression:

Stored size: 574 Bytes

Contents

# 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')
#
EnumItem = Struct.new(:member, :value) do
  def to_s
    self.member
  end

  def to_i
    self.value
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
f5-icontrol-0.3.7 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.6 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.5 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.3 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.2 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.1 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.3.0 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.2.7 lib/f5/icontrol/common/enum_item.rb
f5-icontrol-0.2.6 lib/f5/icontrol/common/enum_item.rb