class ContentfulConverter::Nodes::Text

Public Instance Methods

to_h(params = options) click to toggle source
Calls superclass method ContentfulConverter::Nodes::Base#to_h
# File lib/contentful_converter/nodes/text.rb, line 8
def to_h(params = options)
  return nil if value.strip.empty?

  super
  params.delete(:content)
  params
end

Private Instance Methods

marks() click to toggle source
# File lib/contentful_converter/nodes/text.rb, line 29
def marks
  []
end
options() click to toggle source
# File lib/contentful_converter/nodes/text.rb, line 22
def options
  {
    value: value,
    marks: marks.map { |mark| { type: mark } }
  }
end
type() click to toggle source
# File lib/contentful_converter/nodes/text.rb, line 18
def type
  'text'
end