Sha256: 9bb98bc2bad0790fab25db9a7abc993d9325a76d51cfa21836aa4e55e8117349

Contents?: true

Size: 375 Bytes

Versions: 37

Compression:

Stored size: 375 Bytes

Contents

require "active_resource"

module Ddr::Models
  class Contact < ActiveResource::Base

    self.site = ENV["DDR_AUX_API_URL"]

    def self.call(slug)
      new get(:find, slug: slug)
    rescue ActiveResource::ResourceNotFound => e
      raise Ddr::Models::NotFoundError, e
    end

    def self.keys
      all.map(&:slug)
    end

    def to_s
      name
    end

  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/models/contact.rb
ddr-models-2.10.2 lib/ddr/models/contact.rb
ddr-models-2.10.1 lib/ddr/models/contact.rb
ddr-models-2.10.0 lib/ddr/models/contact.rb
ddr-models-2.10.0.rc2 lib/ddr/models/contact.rb
ddr-models-2.10.0.rc1 lib/ddr/models/contact.rb
ddr-models-2.9.2 lib/ddr/models/contact.rb
ddr-models-2.9.1 lib/ddr/models/contact.rb
ddr-models-2.9.0 lib/ddr/models/contact.rb
ddr-models-2.9.0.rc1 lib/ddr/models/contact.rb
ddr-models-2.8.0 lib/ddr/models/contact.rb
ddr-models-2.8.0.rc1 lib/ddr/models/contact.rb
ddr-models-2.7.6 lib/ddr/models/contact.rb
ddr-models-2.7.5 lib/ddr/models/contact.rb
ddr-models-2.7.4 lib/ddr/models/contact.rb
ddr-models-2.7.3 lib/ddr/models/contact.rb
ddr-models-2.7.2 lib/ddr/models/contact.rb
ddr-models-2.7.1 lib/ddr/models/contact.rb
ddr-models-2.7.0 lib/ddr/models/contact.rb
ddr-models-2.7.0.rc1 lib/ddr/models/contact.rb