lib/remedy/key.rb in remedy-0.2.0 vs lib/remedy/key.rb in remedy-0.3.0
- old
+ new
@@ -13,10 +13,14 @@
def raw
seq
end
+ def enc
+ seq.dump[1..-2]
+ end
+
def name
@name ||= Characters[seq] || :unknown
end
def glyph
@@ -49,19 +53,23 @@
def recognized?
@recognized ||= name != :unknown
end
+ def known?
+ !!Characters[seq]
+ end
+
def single?
@single ||= raw.length == 1
end
def sequence?
@sequence ||= raw.length > 1
end
def to_s
- @to_s ||= name.to_s
+ @to_s ||= known? ? name.to_s : enc
end
def value
raw_value = raw.bytes.to_a.join(' ')
single? ? raw_value : "(#{raw_value})"