Class: Prawn::NameTree::Value
- Inherits:
-
Object
- Object
- Prawn::NameTree::Value
- Includes:
- Comparable
- Defined in:
- lib/prawn/name_tree.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(leaf) ⇒ Object
-
#initialize(name, value) ⇒ Value
constructor
A new instance of Value.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
146 147 148 |
# File 'lib/prawn/name_tree.rb', line 146 def name @name end |
#value ⇒ Object (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 |
#inspect ⇒ Object
157 158 159 |
# File 'lib/prawn/name_tree.rb', line 157 def inspect "#<Value: #{name.inspect} : #{value.inspect}>" end |
#to_s ⇒ Object
161 162 163 |
# File 'lib/prawn/name_tree.rb', line 161 def to_s "#{name} : #{value}" end |