class ContentfulConverter::Nodes::Hyperlink

Private Instance Methods

hyperlink_entry_option(type) click to toggle source
# File lib/contentful_converter/nodes/hyperlink.rb, line 29
def hyperlink_entry_option(type)
  {
    data: {
      target: {
        sys: {
          id: parsed_link.to_s,
          type: 'Link',
          linkType: type
        }
      }
    }
  }
end
options() click to toggle source
# File lib/contentful_converter/nodes/hyperlink.rb, line 18
def options
  return hyperlink_entry_option('Asset') if !uri_scheme? && uri_extension?
  return hyperlink_entry_option('Entry') if !uri_scheme? && !parsed_link.to_s.include?("#")

  hyperlink_option
end
type() click to toggle source
# File lib/contentful_converter/nodes/hyperlink.rb, line 11
def type
  return 'asset-hyperlink' if !uri_scheme? && uri_extension?
  return 'entry-hyperlink' if !uri_scheme? && !parsed_link.to_s.include?("#")

  'hyperlink'
end
uri_extension?() click to toggle source
# File lib/contentful_converter/nodes/hyperlink.rb, line 47
def uri_extension?
  parsed_link.to_s.split('.')[1]
end
uri_scheme?() click to toggle source
# File lib/contentful_converter/nodes/hyperlink.rb, line 43
def uri_scheme?
  parsed_link.scheme
end