Class: Kuhsaft::PublishState
- Inherits:
-
Object
- Object
- Kuhsaft::PublishState
- Extended by:
- ActiveModel::Translation
- Defined in:
- app/models/kuhsaft/publish_state.rb
Constant Summary collapse
- UNPUBLISHED =
0
- PUBLISHED =
1
- PUBLISHED_AT =
2
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ PublishState
constructor
A new instance of PublishState.
Constructor Details
#initialize(options) ⇒ PublishState
Returns a new instance of PublishState.
12 13 14 |
# File 'app/models/kuhsaft/publish_state.rb', line 12 def initialize() .each_pair { |k, v| instance_variable_set("@#{k}", v) if respond_to?(k) } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'app/models/kuhsaft/publish_state.rb', line 9 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'app/models/kuhsaft/publish_state.rb', line 10 def value @value end |
Class Method Details
.all ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/models/kuhsaft/publish_state.rb', line 16 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 |