Class: Pinot::JsonNumber
- Inherits:
-
Object
- Object
- Pinot::JsonNumber
- Defined in:
- lib/pinot/response.rb
Overview
Mirrors Go’s json.Number — stores the raw string representation of a JSON number.
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(raw) ⇒ JsonNumber
constructor
A new instance of JsonNumber.
- #to_s ⇒ Object
Constructor Details
#initialize(raw) ⇒ JsonNumber
Returns a new instance of JsonNumber.
14 15 16 |
# File 'lib/pinot/response.rb', line 14 def initialize(raw) @raw = raw.to_s end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'lib/pinot/response.rb', line 12 def raw @raw end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/pinot/response.rb', line 22 def ==(other) case other when JsonNumber then @raw == other.raw else false end end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/pinot/response.rb', line 18 def to_s @raw end |