Class: Textlint::Nodes::TxtTextNode

Inherits:
TxtNode
  • Object
show all
Defined in:
lib/textlint/nodes.rb

Overview

export interface TxtTextNode extends TxtNode

value: string;

Instance Attribute Summary collapse

Attributes inherited from TxtNode

#loc, #range, #raw, #type

Instance Method Summary collapse

Constructor Details

#initialize(value:, **attributes) ⇒ TxtTextNode

Returns a new instance of TxtTextNode.

Parameters:

  • value (String)
  • attributes (Hash)


177
178
179
180
# File 'lib/textlint/nodes.rb', line 177

def initialize(value:, **attributes)
  @value = value
  super(**attributes)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



173
174
175
# File 'lib/textlint/nodes.rb', line 173

def value
  @value
end

Instance Method Details

#as_textlint_jsonHash

Returns:

  • (Hash)


183
184
185
186
187
# File 'lib/textlint/nodes.rb', line 183

def as_textlint_json
  h = super
  h[:value] = value
  h
end