Class: UncleKryon::BaseData
- Inherits:
-
Object
- Object
- UncleKryon::BaseData
show all
- Defined in:
- lib/unclekryon/data/base_data.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseData.
20
21
22
|
# File 'lib/unclekryon/data/base_data.rb', line 20
def initialize
update
end
|
Instance Attribute Details
#updated_on ⇒ Object
Returns the value of attribute updated_on.
18
19
20
|
# File 'lib/unclekryon/data/base_data.rb', line 18
def updated_on
@updated_on
end
|
Class Method Details
.max_updated_on(data) ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/unclekryon/data/base_data.rb', line 46
def self.max_updated_on(data)
max = nil
if data.is_a?(Hash)
data.each do |k,v|
vuo = Util.parse_datetime_s(v.updated_on)
max = vuo if max.nil? || vuo > max
end
end
return max
end
|
.max_updated_on_s(data) ⇒ Object
63
64
65
|
# File 'lib/unclekryon/data/base_data.rb', line 63
def self.max_updated_on_s(data)
return Util.format_datetime(max_updated_on(data))
end
|
Instance Method Details
#initialize_copy(original) ⇒ Object
24
25
26
27
28
|
# File 'lib/unclekryon/data/base_data.rb', line 24
def initialize_copy(original)
super(original)
@updated_on = @updated_on.clone
end
|
#max_updated_on ⇒ Object
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/unclekryon/data/base_data.rb', line 35
def max_updated_on
max = nil
instance_variables.each do |iv|
vuo = Util.parse_datetime_s(instance_variable_get(iv)) if iv.to_s =~ /\A@updated_.+_on\z/
max = vuo if max.nil? || vuo > max
end
return max
end
|
#max_updated_on_s ⇒ Object
59
60
61
|
# File 'lib/unclekryon/data/base_data.rb', line 59
def max_updated_on_s
return Util.format_datetime(max_updated_on)
end
|
#update ⇒ Object
30
31
32
33
|
# File 'lib/unclekryon/data/base_data.rb', line 30
def update
@updated_on = Util.format_datetime(DateTime.now)
return @updated_on
end
|