Class: Beckett::Node::Text

Inherits:
Base
  • Object
show all
Defined in:
lib/beckett/node/text.rb

Direct Known Subclasses

Codespan

Instance Attribute Summary

Attributes inherited from Base

#children, #node, #position

Instance Method Summary collapse

Methods inherited from Base

#<<, #initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Beckett::Node::Base

Instance Method Details

#nil?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/beckett/node/text.rb', line 11

def nil?
  # improves list rendering.
  node_text.strip.empty?
end

#to_hObject



3
4
5
6
7
8
9
# File 'lib/beckett/node/text.rb', line 3

def to_h
  {}.tap do |element|
    element[:node_name] = node_name
    element[:node_type] = node_type
    element[:node_text] = node_text
  end
end