Class: TaskHelper::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/task_helper/base.rb
Class Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
8
9
10
11
12
13
|
# File 'lib/task_helper/base.rb', line 8
def initialize(args = {})
@info = {}
(args || {}).each_pair do |k, v|
@info[k.to_sym] = v
end
end
|
Class Attribute Details
.data_members ⇒ Object
Returns the value of attribute data_members.
4
5
6
|
# File 'lib/task_helper/base.rb', line 4
def data_members
@data_members
end
|
Instance Method Details
#==(other) ⇒ Object
31
32
33
|
# File 'lib/task_helper/base.rb', line 31
def ==(other)
id == other.id
end
|
#created_at ⇒ Object
23
24
25
|
# File 'lib/task_helper/base.rb', line 23
def created_at
Time.parse(fetch(:created_at)) if fetch(:created_at)
end
|
#id ⇒ Object
19
20
21
|
# File 'lib/task_helper/base.rb', line 19
def id
fetch(:id)
end
|
#to_h ⇒ Object
15
16
17
|
# File 'lib/task_helper/base.rb', line 15
def to_h
@info.dup
end
|
#updated_at ⇒ Object
27
28
29
|
# File 'lib/task_helper/base.rb', line 27
def updated_at
Time.parse(fetch(:updated_at)) if fetch(:updated_at)
end
|