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