Module: Ably::Modules::Enum

Included in:
Ably::Models::PresenceMessage, Ably::Models::ProtocolMessage, Ably::Models::Stats
Defined in:
lib/submodules/ably-ruby/lib/ably/modules/enum.rb

Overview

Enum brings Enum like functionality used in other languages to Ruby

Examples:

class House
  extend Ably::Moduels::Enum
  CONSTRUCTION = ruby_enum('CONSTRUCTION',
    :brick,
    :steel,
    :wood
  )
end

House::CONSTRUCTION(:brick).to_i # => 0
House::CONSTRUCTION('Wood').to_i # => 2
House::CONSTRUCTION.Wood == :wood # => true

Defined Under Namespace

Classes: Base