Class: Hierogloss::MdC::Sign

Inherits:
Block
  • Object
show all
Defined in:
lib/hierogloss/mdc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Sign

Returns a new instance of Sign.



12
13
14
# File 'lib/hierogloss/mdc.rb', line 12

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/hierogloss/mdc.rb', line 10

def name
  @name
end

Instance Method Details

#to_debugObject



20
21
22
# File 'lib/hierogloss/mdc.rb', line 20

def to_debug
  name
end

#to_linear_hieroglyphsObject



24
25
26
# File 'lib/hierogloss/mdc.rb', line 24

def to_linear_hieroglyphs
  to_unicode
end

#to_mdc(precedence) ⇒ Object



28
29
30
31
32
33
# File 'lib/hierogloss/mdc.rb', line 28

def to_mdc(precedence)
  mdc = Hierogloss::Dictionary.sign_to_mdc(name) || name
  # Wrap composite signs in parens.
  return "(#{mdc})" if mdc =~ /[-:*]/
  mdc
end

#to_unicodeObject



16
17
18
# File 'lib/hierogloss/mdc.rb', line 16

def to_unicode
  Hierogloss::Dictionary.mdc_to_sign(name) || name
end