Sha256: 9294659a1dfca5419caa3c9b9cf3c78fd78d0469730763649b7a3c2d58b138b0

Contents?: true

Size: 454 Bytes

Versions: 13

Compression:

Stored size: 454 Bytes

Contents

module CurationConcerns
  class Group
    def initialize(name)
      @name = name
    end

    attr_reader :name

    def to_sipity_agent
      sipity_agent || create_sipity_agent!
    end

    private

      def sipity_agent
        Sipity::Agent.find_by(proxy_for_id: name, proxy_for_type: self.class.name)
      end

      def create_sipity_agent!
        Sipity::Agent.create!(proxy_for_id: name, proxy_for_type: self.class.name)
      end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/models/curation_concerns/group.rb
curation_concerns-1.7.7 app/models/curation_concerns/group.rb
curation_concerns-2.0.0 app/models/curation_concerns/group.rb
curation_concerns-2.0.0.rc2 app/models/curation_concerns/group.rb
curation_concerns-1.7.6 app/models/curation_concerns/group.rb
curation_concerns-1.7.5 app/models/curation_concerns/group.rb
curation_concerns-1.7.4 app/models/curation_concerns/group.rb
curation_concerns-1.7.3 app/models/curation_concerns/group.rb
curation_concerns-1.7.2 app/models/curation_concerns/group.rb
curation_concerns-2.0.0.rc1 app/models/curation_concerns/group.rb
curation_concerns-1.7.1 app/models/curation_concerns/group.rb
curation_concerns-1.7.0 app/models/curation_concerns/group.rb
curation_concerns-1.7.0.beta1 app/models/curation_concerns/group.rb