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.
34
35
36
37
|
# File 'lib/kameleoon/data/data.rb', line 34
def initialize(data_type)
@instance = data_type
@state = DataState::UNSENT
end
|
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
32
33
34
|
# File 'lib/kameleoon/data/data.rb', line 32
def instance
@instance
end
|
Instance Method Details
#mark_as_sent ⇒ Object
63
64
65
66
|
# File 'lib/kameleoon/data/data.rb', line 63
def mark_as_sent
@state = DataState::SENT
@nonce = nil
end
|
#mark_as_transmitting ⇒ Object
59
60
61
|
# File 'lib/kameleoon/data/data.rb', line 59
def mark_as_transmitting
@state = DataState::TRANSMITTING if unsent
end
|
#mark_as_unsent ⇒ Object
55
56
57
|
# File 'lib/kameleoon/data/data.rb', line 55
def mark_as_unsent
@state = DataState::UNSENT if transmitting
end
|
#obtain_full_post_text_line ⇒ Object
39
40
41
|
# File 'lib/kameleoon/data/data.rb', line 39
def obtain_full_post_text_line
raise KameleoonError.new('ToDo: implement this method.'), 'ToDo: implement this method.'
end
|
#sent ⇒ Object
51
52
53
|
# File 'lib/kameleoon/data/data.rb', line 51
def sent
@state == DataState::SENT
end
|
#transmitting ⇒ Object
47
48
49
|
# File 'lib/kameleoon/data/data.rb', line 47
def transmitting
@state == DataState::TRANSMITTING
end
|
#unsent ⇒ Object
43
44
45
|
# File 'lib/kameleoon/data/data.rb', line 43
def unsent
@state == DataState::UNSENT
end
|