Sha256: e5adf417cd88f4a5491355be0b5fdae142164fde674637c5cb081208354042ee

Contents?: true

Size: 326 Bytes

Versions: 8

Compression:

Stored size: 326 Bytes

Contents

module Arbetsformedlingen
  class Model
    def self.from_schema(schema)
      new(schema)
    end

    attr_reader :schema

    def initialize(schema)
      @schema = schema
    end

    def valid?
      @schema.success?
    end

    def errors
      @schema.errors
    end

    def to_h
      @schema.to_h
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
arbetsformedlingen-0.5.0 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.4.1 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.4.0 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.3.0 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.2.0 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.1.2 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.1.1 lib/arbetsformedlingen/models/model.rb
arbetsformedlingen-0.1.0 lib/arbetsformedlingen/models/model.rb