Class: Meibo::ProcessingMode
- Inherits:
-
Object
- Object
- Meibo::ProcessingMode
- Defined in:
- lib/meibo/processing_mode.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #absent? ⇒ Boolean
- #bulk? ⇒ Boolean
- #delta? ⇒ Boolean
-
#initialize(mode) ⇒ ProcessingMode
constructor
A new instance of ProcessingMode.
- #to_s ⇒ Object
Constructor Details
#initialize(mode) ⇒ ProcessingMode
Returns a new instance of ProcessingMode.
21 22 23 24 |
# File 'lib/meibo/processing_mode.rb', line 21 def initialize(mode) @mode = mode freeze end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
5 6 7 |
# File 'lib/meibo/processing_mode.rb', line 5 def mode @mode end |
Class Method Details
.absent ⇒ Object
8 9 10 |
# File 'lib/meibo/processing_mode.rb', line 8 def absent @absent ||= ProcessingMode.new("absent") end |
.bulk ⇒ Object
12 13 14 |
# File 'lib/meibo/processing_mode.rb', line 12 def bulk @bulk ||= ProcessingMode.new("bulk") end |
.delta ⇒ Object
16 17 18 |
# File 'lib/meibo/processing_mode.rb', line 16 def delta @delta ||= ProcessingMode.new("delta") end |
Instance Method Details
#==(other) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/meibo/processing_mode.rb', line 38 def ==(other) case other when ProcessingMode @mode == other.mode when String to_s == other else false end end |
#absent? ⇒ Boolean
26 27 28 |
# File 'lib/meibo/processing_mode.rb', line 26 def absent? @mode == "absent" end |
#bulk? ⇒ Boolean
30 31 32 |
# File 'lib/meibo/processing_mode.rb', line 30 def bulk? @mode == "bulk" end |
#delta? ⇒ Boolean
34 35 36 |
# File 'lib/meibo/processing_mode.rb', line 34 def delta? @mode == "delta" end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/meibo/processing_mode.rb', line 49 def to_s @mode end |