Class: Flipper::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/flipper/type.rb

Overview

Internal: Root class for all flipper types. You should never need to use this.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/flipper/type.rb', line 9

def value
  @value
end

Class Method Details

.wrap(value_or_instance) ⇒ Object



4
5
6
7
# File 'lib/flipper/type.rb', line 4

def self.wrap(value_or_instance)
  return value_or_instance if value_or_instance.is_a?(self)
  new(value_or_instance)
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


11
12
13
# File 'lib/flipper/type.rb', line 11

def eql?(other)
  self.class.eql?(other.class) && value == other.value
end