Class: Strava::Models::Comment

Inherits:
Response show all
Defined in:
lib/strava/models/comment.rb

Overview

Represents a comment on a Strava activity.

Comments are text messages left by athletes on activities. Each comment includes the text content, the athlete who made the comment, and timestamp.

Examples:

List activity comments

comments = client.activity_comments(1234567890)
comments.each do |comment|
  puts "#{comment.athlete.name}: #{comment.text}"
  puts "Posted at: #{comment.created_at}"
end

See Also:

  • Api::Client#activity_comments

Instance Method Summary collapse

Instance Method Details

#activity_idInteger

Returns ID of the activity this comment is on.

Returns:

  • (Integer)

    ID of the activity this comment is on



25
# File 'lib/strava/models/comment.rb', line 25

property 'activity_id'

#athleteSummaryAthlete

Returns The athlete who made the comment.

Returns:



34
# File 'lib/strava/models/comment.rb', line 34

property 'athlete', transform_with: ->(v) { Strava::Models::SummaryAthlete.new(v) }

#created_atTime

Returns When the comment was created.

Returns:

  • (Time)

    When the comment was created



31
# File 'lib/strava/models/comment.rb', line 31

property 'created_at', transform_with: ->(v) { Time.parse(v) }

#has_reactedBoolean?

Note:

Undocumented in official API

Returns Whether the authenticated athlete has reacted to this comment.

Returns:

  • (Boolean, nil)

    Whether the authenticated athlete has reacted to this comment



54
# File 'lib/strava/models/comment.rb', line 54

property 'has_reacted'

#idInteger

Returns Comment ID.

Returns:

  • (Integer)

    Comment ID



22
# File 'lib/strava/models/comment.rb', line 22

property 'id'

#mentions_metadataHash?

Note:

Undocumented in official API

Returns Metadata about @mentions in the comment.

Returns:

  • (Hash, nil)

    Metadata about @mentions in the comment



46
# File 'lib/strava/models/comment.rb', line 46

property 'mentions_metadata'

#post_idInteger?

Note:

Undocumented in official API

Returns Associated post ID.

Returns:

  • (Integer, nil)

    Associated post ID



38
# File 'lib/strava/models/comment.rb', line 38

property 'post_id'

#reaction_countInteger?

Note:

Undocumented in official API

Returns Number of reactions on this comment.

Returns:

  • (Integer, nil)

    Number of reactions on this comment



50
# File 'lib/strava/models/comment.rb', line 50

property 'reaction_count'

#resource_stateInteger?

Note:

Undocumented in official API

Returns Resource state indicator.

Returns:

  • (Integer, nil)

    Resource state indicator



42
# File 'lib/strava/models/comment.rb', line 42

property 'resource_state'

#textString

Returns The comment text.

Returns:

  • (String)

    The comment text



28
# File 'lib/strava/models/comment.rb', line 28

property 'text'