Class: Limited::Actor::Identifier
- Inherits:
-
Object
- Object
- Limited::Actor::Identifier
- Defined in:
- lib/limited/actor.rb
Instance Attribute Summary collapse
-
#hash_keys ⇒ Object
readonly
Returns the value of attribute hash_keys.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
-
#initialize(*symbols) ⇒ Identifier
constructor
A new instance of Identifier.
Constructor Details
#initialize(*symbols) ⇒ Identifier
Returns a new instance of Identifier.
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_keys ⇒ Object (readonly)
Returns the value of attribute hash_keys.
6 7 8 |
# File 'lib/limited/actor.rb', line 6 def hash_keys @hash_keys end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
5 6 7 |
# File 'lib/limited/actor.rb', line 5 def keys @keys end |