class Committee::Drivers::HyperSchema::Link
Link
abstracts an API link specifically for JSON hyper-schema.
For most operations, it’s a simple pass through to a JsonSchema::Schema::Link, but implements some exotic behavior in a few places.
Attributes
Public Class Methods
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 12 def initialize(hyper_schema_link) @hyper_schema_link = hyper_schema_link end
Public Instance Methods
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 17 def enc_type hyper_schema_link.enc_type end
The link’s input media type. i.e. How requests should be encoded.
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 21 def href hyper_schema_link.href end
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 26 def media_type hyper_schema_link.media_type end
The link’s output media type. i.e. How responses should be encoded.
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 30 def method hyper_schema_link.method end
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 38 def parent hyper_schema_link.parent end
Passes through a link’s parent resource. Note that this is not part of the Link
interface and is here to support a legacy Heroku-ism behavior that allowed a link tagged with rel=instances to imply that a list will be returned.
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 42 def rel hyper_schema_link.rel end
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 48 def schema hyper_schema_link.schema end
The link’s input schema. i.e. How we validate an endpoint’s incoming parameters.
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 52 def status_success hyper_schema_link.rel == "create" ? 201 : 200 end
Source
# File lib/committee/drivers/hyper_schema/link.rb, line 58 def target_schema hyper_schema_link.target_schema end
The link’s output schema. i.e. How we validate an endpoint’s response data.