Class: Squared::Common::SymSet
- Inherits:
-
Object
- Object
- Squared::Common::SymSet
- Extended by:
- Forwardable
- Defined in:
- lib/squared/common/class.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add(val) ⇒ Object
-
#initialize(data = []) ⇒ SymSet
constructor
A new instance of SymSet.
- #to_a ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(data = []) ⇒ SymSet
Returns a new instance of SymSet.
17 18 19 |
# File 'lib/squared/common/class.rb', line 17 def initialize(data = []) @data = Set.new(data) end |
Class Method Details
.to_s ⇒ Object
11 12 13 |
# File 'lib/squared/common/class.rb', line 11 def self.to_s super[/[^:]+\z/, 0] end |
Instance Method Details
#add(val) ⇒ Object
21 22 23 |
# File 'lib/squared/common/class.rb', line 21 def add(val) @data.add(val.to_sym) end |
#to_a ⇒ Object
25 26 27 |
# File 'lib/squared/common/class.rb', line 25 def to_a @data.to_a.freeze end |