Class: NotionRb::Utils::Parser
- Inherits:
-
Object
- Object
- NotionRb::Utils::Parser
- Includes:
- Types
- Defined in:
- lib/notion_rb/utils/parser.rb
Constant Summary
Constants included from Types
Instance Method Summary collapse
-
#initialize(value, position) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Methods included from Types
#select_parser, #valid_block_type?
Constructor Details
#initialize(value, position) ⇒ Parser
Returns a new instance of Parser.
8 9 10 11 12 13 14 15 16 |
# File 'lib/notion_rb/utils/parser.rb', line 8 def initialize(value, position) unless valid_block_type?(value['type']) raise ArgumentError, 'Invalid block type' end @value = value @position = position @parser = select_parser @value['type'] end |
Instance Method Details
#parse ⇒ Object
18 19 20 |
# File 'lib/notion_rb/utils/parser.rb', line 18 def parse @parser == :null ? null : base end |