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.3.4.rc2 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.4.rc1 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.3 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.2 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.5 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.4 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.3 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.1 app/models/kuhsaft/publish_state.rb
kuhsaft-0.3.0 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.2 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2.1 app/models/kuhsaft/publish_state.rb
kuhsaft-0.2 app/models/kuhsaft/publish_state.rb