lib/nydp/symbol.rb in nydp-0.1.13.2 vs lib/nydp/symbol.rb in nydp-0.1.14

- old
+ new

@@ -1,13 +1,15 @@ class Nydp::Symbol EMPTY = :"" attr_accessor :name + attr_reader :hash def initialize name @name = name.to_sym @inspection = name.to_s @inspection = "|#{name}|" if untidy(@inspection) + @hash = name.hash end def untidy str (str == "") || (str == nil) || (str =~ /\s/) end @@ -35,10 +37,9 @@ def nydp_type ; :symbol ; end def inspect ; @inspection ; end def to_s ; name.to_s ; end def to_sym ; name ; end def to_ruby ; to_sym ; end - def hash ; name.hash ; end def eql? other ; self == other ; end def is? nm ; self.name == nm.to_sym ; end def > other ; self.name > other.name ; end def < other ; self.name < other.name ; end def <=> other ; self.name <=> other.name ; end