Class: TimeTree::Activity

Inherits:
BaseModel show all
Defined in:
lib/timetree/models/activity.rb

Overview

Model for TimeTree comment.

Constant Summary collapse

TIME_FIELDS =
%i[updated_at created_at].freeze

Instance Attribute Summary collapse

Attributes inherited from BaseModel

#id, #relationships, #type

Instance Method Summary collapse

Methods inherited from BaseModel

#initialize, #inspect, to_model

Constructor Details

This class inherits a constructor from TimeTree::BaseModel

Instance Attribute Details

#calendar_idString

calendar’s id.

Returns:

  • (String)


16
17
18
# File 'lib/timetree/models/activity.rb', line 16

def calendar_id
  @calendar_id
end

#contentString

Returns:

  • (String)


9
10
11
# File 'lib/timetree/models/activity.rb', line 9

def content
  @content
end

#created_atTime

Returns:

  • (Time)


13
14
15
# File 'lib/timetree/models/activity.rb', line 13

def created_at
  @created_at
end

#event_idString

event’s id.

Returns:

  • (String)


19
20
21
# File 'lib/timetree/models/activity.rb', line 19

def event_id
  @event_id
end

#updated_atTime

Returns:

  • (Time)


11
12
13
# File 'lib/timetree/models/activity.rb', line 11

def updated_at
  @updated_at
end

Instance Method Details

#createTimeTree::Activity

Creates a comment to the associated event.

Returns:

Raises:

Since:

  • 0.0.1



32
33
34
35
# File 'lib/timetree/models/activity.rb', line 32

def create
  check_client
  _create
end

#data_paramsHash

convert to a TimeTree request body format.

Returns:

  • (Hash)

Since:

  • 0.0.1



42
43
44
45
46
# File 'lib/timetree/models/activity.rb', line 42

def data_params
  {
    data: {attributes: {content: content}}
  }
end