Class: Habaki::Value
Overview
abstract value type
Direct Known Subclasses
Angle, Function, HexColor, Ident, Length, Number, Operator, Percentage, String, UnicodeRange, Url
Instance Attribute Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(data = nil) ⇒ Value
constructor
A new instance of Value.
- #read_from_katana(val) ⇒ void private
- #string(format = Formatter::Base.new) ⇒ String
Methods inherited from Node
Constructor Details
#initialize(data = nil) ⇒ Value
Returns a new instance of Value.
7 8 9 |
# File 'lib/habaki/value.rb', line 7 def initialize(data = nil) @data = data end |
Instance Attribute Details
#data ⇒ ::String, Float
5 6 7 |
# File 'lib/habaki/value.rb', line 5 def data @data end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 |
# File 'lib/habaki/value.rb', line 11 def ==(other) to_s == other.to_s end |
#eql?(other) ⇒ Boolean
15 16 17 |
# File 'lib/habaki/value.rb', line 15 def eql?(other) to_s.eql?(other.to_s) end |
#hash ⇒ Object
19 20 21 |
# File 'lib/habaki/value.rb', line 19 def hash to_s.hash end |
#read_from_katana(val) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
32 33 34 |
# File 'lib/habaki/value.rb', line 32 def read_from_katana(val) @data = val.value end |