Class: Flipper::Actor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flipper_id, flipper_properties = {}) ⇒ Actor

Returns a new instance of Actor.



7
8
9
10
# File 'lib/flipper/actor.rb', line 7

def initialize(flipper_id, flipper_properties = {})
  @flipper_id = flipper_id
  @flipper_properties = flipper_properties
end

Instance Attribute Details

#flipper_idObject (readonly)

Returns the value of attribute flipper_id.



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

def flipper_id
  @flipper_id
end

#flipper_propertiesObject (readonly)

Returns the value of attribute flipper_properties.



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

def flipper_properties
  @flipper_properties
end

Instance Method Details

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

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/flipper/actor.rb', line 12

def eql?(other)
  self.class.eql?(other.class) &&
    @flipper_id == other.flipper_id &&
    @flipper_properties == other.flipper_properties
end

#hashObject



19
20
21
# File 'lib/flipper/actor.rb', line 19

def hash
  flipper_id.hash
end