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.
13 14 15 |
# File 'app/models/kuhsaft/publish_state.rb', line 13 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.
10 11 12 |
# File 'app/models/kuhsaft/publish_state.rb', line 10 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
11 12 13 |
# File 'app/models/kuhsaft/publish_state.rb', line 11 def value @value end |
Class Method Details
.all ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/models/kuhsaft/publish_state.rb', line 17 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 |