Class: Shaf::Yard::LinkObject
- Inherits:
-
YARD::CodeObjects::Base
- Object
- YARD::CodeObjects::Base
- Shaf::Yard::LinkObject
- Defined in:
- lib/shaf/yard/link_object.rb
Instance Attribute Summary collapse
-
#curie ⇒ Object
Returns the value of attribute curie.
-
#rel ⇒ Object
Returns the value of attribute rel.
Instance Method Summary collapse
- #content_type ⇒ Object
- #curie? ⇒ Boolean
- #descriptor ⇒ Object
- #documentation ⇒ Object
- #href ⇒ Object
- #http_methods ⇒ Object
- #iana_doc ⇒ Object
- #profile ⇒ Object
- #profile_doc ⇒ Object
- #profile_object ⇒ Object
Instance Attribute Details
#curie ⇒ Object
Returns the value of attribute curie.
8 9 10 |
# File 'lib/shaf/yard/link_object.rb', line 8 def curie @curie end |
#rel ⇒ Object
Returns the value of attribute rel.
8 9 10 |
# File 'lib/shaf/yard/link_object.rb', line 8 def rel @rel end |
Instance Method Details
#content_type ⇒ Object
50 51 52 |
# File 'lib/shaf/yard/link_object.rb', line 50 def content_type descriptor&.content_type end |
#curie? ⇒ Boolean
10 11 12 |
# File 'lib/shaf/yard/link_object.rb', line 10 def curie? !!curie end |
#descriptor ⇒ Object
34 35 36 |
# File 'lib/shaf/yard/link_object.rb', line 34 def descriptor profile&.find_relation(rel) end |
#documentation ⇒ Object
14 15 16 |
# File 'lib/shaf/yard/link_object.rb', line 14 def documentation profile_doc || iana_doc || 'Undocumented' end |
#href ⇒ Object
46 47 48 |
# File 'lib/shaf/yard/link_object.rb', line 46 def href descriptor&.href end |
#http_methods ⇒ Object
42 43 44 |
# File 'lib/shaf/yard/link_object.rb', line 42 def http_methods Array(descriptor&.http_methods) end |
#iana_doc ⇒ Object
54 55 56 |
# File 'lib/shaf/yard/link_object.rb', line 54 def iana_doc LinkRelations.get(name)&.description end |
#profile ⇒ Object
27 28 29 30 31 32 |
# File 'lib/shaf/yard/link_object.rb', line 27 def profile return @profile if defined? @profile return unless namespace.respond_to? :profile profile = namespace.profile @profile = profile&.find_relation(name) && profile end |
#profile_doc ⇒ Object
38 39 40 |
# File 'lib/shaf/yard/link_object.rb', line 38 def profile_doc descriptor&.doc end |
#profile_object ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/shaf/yard/link_object.rb', line 18 def profile_object return unless profile return unless namespace.respond_to? :profile_objects namespace.profile_objects.find do |po| po.profile == profile end end |