Sha256: f015d159e4ad3b4b93780842c0df72b860a7efba6109b4d1ad30026045fa17e9

Contents?: true

Size: 560 Bytes

Versions: 16

Compression:

Stored size: 560 Bytes

Contents

module Qbrick
  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

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 app/models/qbrick/publish_state.rb
qbrick-2.7 app/models/qbrick/publish_state.rb
qbrick-2.6.10 app/models/qbrick/publish_state.rb
qbrick-2.6.9 app/models/qbrick/publish_state.rb
qbrick-2.6.8 app/models/qbrick/publish_state.rb
qbrick-2.6.7 app/models/qbrick/publish_state.rb
qbrick-2.6.6 app/models/qbrick/publish_state.rb
qbrick-2.6.5 app/models/qbrick/publish_state.rb
qbrick-2.6.4 app/models/qbrick/publish_state.rb
qbrick-2.6.3 app/models/qbrick/publish_state.rb
qbrick-2.6.2 app/models/qbrick/publish_state.rb
qbrick-2.6.1 app/models/qbrick/publish_state.rb
qbrick-2.6.0 app/models/qbrick/publish_state.rb
qbrick-2.5.2 app/models/qbrick/publish_state.rb
qbrick-2.5.1 app/models/qbrick/publish_state.rb
qbrick-2.5.0 app/models/qbrick/publish_state.rb