Class: StructuredReader::JSONReader::NumberReader
- Inherits:
-
Object
- Object
- StructuredReader::JSONReader::NumberReader
- Defined in:
- lib/structured_reader.rb
Instance Method Summary collapse
-
#initialize(**_) ⇒ NumberReader
constructor
A new instance of NumberReader.
- #read(fragment, context) ⇒ Object
Constructor Details
#initialize(**_) ⇒ NumberReader
Returns a new instance of NumberReader.
158 159 160 |
# File 'lib/structured_reader.rb', line 158 def initialize(**_) end |
Instance Method Details
#read(fragment, context) ⇒ Object
162 163 164 165 166 167 168 |
# File 'lib/structured_reader.rb', line 162 def read(fragment, context) if fragment.kind_of?(Numeric) context.accept fragment else context.flunk(fragment, "expected a Numeric") end end |