Class: Prawn::NameTree::Value

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/prawn/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.


149
150
151
# File 'lib/prawn/name_tree.rb', line 149

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


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

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value


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

def value
  @value
end

Instance Method Details

#<=>(leaf) ⇒ Object


153
154
155
# File 'lib/prawn/name_tree.rb', line 153

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

#inspectObject


157
158
159
# File 'lib/prawn/name_tree.rb', line 157

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

#to_sObject


161
162
163
# File 'lib/prawn/name_tree.rb', line 161

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