Class: Limited::Actor::Identifier

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*symbols) ⇒ Identifier

Returns a new instance of Identifier.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
16
# File 'lib/limited/actor.rb', line 8

def initialize(*symbols)
  raise ArgumentError.new("The symbols passed need to be unique") unless symbols.uniq.size == symbols.uniq.size
  @keys = symbols.sort
  @hash_keys = {}
  @keys.each do |k|
    raise ArgumentError.new("You need to pass a list of symbols") unless k.is_a?(Symbol)
    @hash_keys[k] = nil
  end
end

Instance Attribute Details

#hash_keysObject (readonly)

Returns the value of attribute hash_keys.



6
7
8
# File 'lib/limited/actor.rb', line 6

def hash_keys
  @hash_keys
end

#keysObject (readonly)

Returns the value of attribute keys.



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

def keys
  @keys
end