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