Class: SvgConform::References::RelativePathReference

Inherits:
BaseReference
  • Object
show all
Defined in:
lib/svg_conform/references/base_reference.rb

Overview

Relative path reference (could be internal or external depending on context)

Instance Method Summary collapse

Methods inherited from BaseReference

#internally_validatable?, #requires_consumer_validation?, #to_h

Instance Method Details

#fragment_componentObject



111
112
113
114
# File 'lib/svg_conform/references/base_reference.rb', line 111

def fragment_component
  parts = value.split("#")
  parts.size > 1 ? parts.last : nil
end

#has_fragment?Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/svg_conform/references/base_reference.rb', line 103

def has_fragment?
  value.include?("#")
end

#path_componentObject



107
108
109
# File 'lib/svg_conform/references/base_reference.rb', line 107

def path_component
  value.split("#").first
end

#validation_scopeObject



99
100
101
# File 'lib/svg_conform/references/base_reference.rb', line 99

def validation_scope
  :external
end