Class: Shaf::Yard::LinkMethodHandler
Overview
Handles call to Shaf::Serializer::link
Instance Method Summary
collapse
#process, #serializer_namespace
Instance Method Details
#curie ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/shaf/yard/link_method_handler.rb', line 23
def curie
m = name.match(/([^:]+):/)
return m[1] if m
statement.parameters(false).each do |param|
next unless param&.respond_to? :source
str = String(param.source)
m = str.match(/curie:\s:?(\w+)/)
return m[1] if m
end
nil
end
|
#name ⇒ Object
19
20
21
|
# File 'lib/shaf/yard/link_method_handler.rb', line 19
def name
super.sub(/[^:]+:/, '')
end
|
#object ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/shaf/yard/link_method_handler.rb', line 11
def object
LinkObject.new(serializer_namespace, name).tap do |link|
link.dynamic = true
link.rel = name
link.curie = curie
end
end
|