Class: Kameleoon::Data
- Inherits:
-
Object
show all
- Defined in:
- lib/kameleoon/data/data.rb
Overview
Represents base class for any Kameleoon data
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(data_type) ⇒ Data
Returns a new instance of Data.
31
32
33
34
|
# File 'lib/kameleoon/data/data.rb', line 31
def initialize(data_type)
@instance = data_type
@state = DataState::UNSENT
end
|
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
29
30
31
|
# File 'lib/kameleoon/data/data.rb', line 29
def instance
@instance
end
|
Instance Method Details
#mark_as_sent ⇒ Object
60
61
62
63
|
# File 'lib/kameleoon/data/data.rb', line 60
def mark_as_sent
@state = DataState::SENT
@nonce = nil
end
|
#mark_as_transmitting ⇒ Object
56
57
58
|
# File 'lib/kameleoon/data/data.rb', line 56
def mark_as_transmitting
@state = DataState::TRANSMITTING if unsent
end
|
#mark_as_unsent ⇒ Object
52
53
54
|
# File 'lib/kameleoon/data/data.rb', line 52
def mark_as_unsent
@state = DataState::UNSENT if transmitting
end
|
#obtain_full_post_text_line ⇒ Object
36
37
38
|
# File 'lib/kameleoon/data/data.rb', line 36
def obtain_full_post_text_line
raise KameleoonError.new('ToDo: implement this method.'), 'ToDo: implement this method.'
end
|
#sent ⇒ Object
48
49
50
|
# File 'lib/kameleoon/data/data.rb', line 48
def sent
@state == DataState::SENT
end
|
#transmitting ⇒ Object
44
45
46
|
# File 'lib/kameleoon/data/data.rb', line 44
def transmitting
@state == DataState::TRANSMITTING
end
|
#unsent ⇒ Object
40
41
42
|
# File 'lib/kameleoon/data/data.rb', line 40
def unsent
@state == DataState::UNSENT
end
|