Sha256: 06ec146fb2cb6d08608a4304c5bc7a739ca13a2782f4459e53364aa8859ae307

Contents?: true

Size: 595 Bytes

Versions: 72

Compression:

Stored size: 595 Bytes

Contents

module Kuhsaft
  class PublishState
    
    extend ActiveModel::Translation
    
    UNPUBLISHED = 0
    PUBLISHED = 1
    PUBLISHED_AT = 2
    
    attr_reader :name
    attr_reader :value
    
    def initialize options
      options.each_pair { |k,v| instance_variable_set("@#{k}", v) if respond_to?(k) }
    end

    def self.all
      @all ||= [
        PublishState.new(:name => 'published', :value => PUBLISHED),
        PublishState.new(:name => 'unpublished', :value => UNPUBLISHED),
        PublishState.new(:name => 'published_at', :value => PUBLISHED_AT)
        ]
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
kuhsaft-0.2.legacy4 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.4.legacy3 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.6 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.5 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.4 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.3 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.2 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.1 app/models/kuhsaft/publish_state.rb
kuhsaft-2.2.0 app/models/kuhsaft/publish_state.rb
kuhsaft-2.1.2 app/models/kuhsaft/publish_state.rb
kuhsaft-2.1.1 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.legacy3 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.legacy2 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.legacy app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.4.legacy2 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.4.legacy app/models/kuhsaft/publish_state.rb
kuhsaft-2.1.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.8.6 app/models/kuhsaft/publish_state.rb
kuhsaft-1.8.5 app/models/kuhsaft/publish_state.rb
kuhsaft-2.0.3 app/models/kuhsaft/publish_state.rb