Class: Prawn::Core::NameTree::Value

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/prawn/core/name_tree.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ Value

Returns a new instance of Value.



147
148
149
# File 'lib/prawn/core/name_tree.rb', line 147

def initialize(name, value)
  @name, @value = Prawn::Core::LiteralString.new(name), value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



144
145
146
# File 'lib/prawn/core/name_tree.rb', line 144

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



145
146
147
# File 'lib/prawn/core/name_tree.rb', line 145

def value
  @value
end

Instance Method Details

#<=>(leaf) ⇒ Object



151
152
153
# File 'lib/prawn/core/name_tree.rb', line 151

def <=>(leaf)
  name <=> leaf.name
end

#inspectObject



155
156
157
# File 'lib/prawn/core/name_tree.rb', line 155

def inspect
  "#<Value: #{name.inspect} : #{value.inspect}>"
end

#to_sObject



159
160
161
# File 'lib/prawn/core/name_tree.rb', line 159

def to_s
  "#{name} : #{value}"
end