Class: Squared::Common::SymSet
- Inherits:
-
Object
- Object
- Squared::Common::SymSet
- Extended by:
- Forwardable
- Defined in:
- lib/squared/common/class.rb
Instance Method Summary collapse
- #add(val) ⇒ Object
-
#initialize(data = []) ⇒ SymSet
constructor
A new instance of SymSet.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(data = []) ⇒ SymSet
Returns a new instance of SymSet.
13 14 15 |
# File 'lib/squared/common/class.rb', line 13 def initialize(data = []) @data = Set.new(data) end |
Instance Method Details
#add(val) ⇒ Object
17 18 19 |
# File 'lib/squared/common/class.rb', line 17 def add(val) @data.add(val.to_sym) end |
#to_s ⇒ Object Also known as: inspect
21 22 23 |
# File 'lib/squared/common/class.rb', line 21 def to_s @data.to_s.sub('Set', SymSet.to_s) end |