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-2.0.2 app/models/kuhsaft/publish_state.rb
kuhsaft-1.8.4 app/models/kuhsaft/publish_state.rb
kuhsaft-1.8.1 app/models/kuhsaft/publish_state.rb
kuhsaft-2.0.1 app/models/kuhsaft/publish_state.rb
kuhsaft-2.0.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.8.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.7.1 app/models/kuhsaft/publish_state.rb
kuhsaft-1.7.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.6.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.5.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.4.3 app/models/kuhsaft/publish_state.rb
kuhsaft-1.4.2 app/models/kuhsaft/publish_state.rb
kuhsaft-1.4.1 app/models/kuhsaft/publish_state.rb
kuhsaft-1.4.0 app/models/kuhsaft/publish_state.rb
kuhsaft-1.3.1 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.6 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.5 app/models/kuhsaft/publish_state.rb
kuhsaft-1.2.15 app/models/kuhsaft/publish_state.rb
kuhsaft-1.2.14 app/models/kuhsaft/publish_state.rb
kuhsaft-1.2.13 app/models/kuhsaft/publish_state.rb