Sha256: 8c0b1da62de5073ca52d33ef18eea0d8b5e3be2d43d7acae696096f67eacd113

Contents?: true

Size: 434 Bytes

Versions: 26

Compression:

Stored size: 434 Bytes

Contents

module JSONAPIonify::Structure
  module Maps
    class Links < Base

      value_is Objects::Link

      validate_each! message: 'must be url string or valid link object' do |obj, key, value|
        case value
        when String
          uri = URI.parse(value)
          uri.scheme.present?
        when Objects::Link
          true
        else
          false
        end || !obj.permitted_key?(key)
      end

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
jsonapionify-0.12.10 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.9 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.8 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.7 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.5 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.4 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.3 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.2 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.1 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.12.0 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.11 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.10 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.9 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.8 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.7 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.6 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.5 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.11.0 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.10.2 lib/jsonapionify/structure/maps/links.rb
jsonapionify-0.10.1 lib/jsonapionify/structure/maps/links.rb