Class: VtApi::ApiV2::Comments::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/vt_api/api/v2/comments.rb

Overview

Representation of a comment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date_token, text) ⇒ Comment

Creates new Comment object from API data. It is not recommended to use this directly. Refer to API methods instead.

Parameters:

  • date_token (String)

    Date token as present in API (can be used in Comments.get).

  • text (String)

    Comment text

See Also:



23
24
25
26
27
# File 'lib/vt_api/api/v2/comments.rb', line 23

def initialize(date_token, text)
	@date_token = date_token
	@date       = DateTime.parse date_token
	@text       = text
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



12
13
14
# File 'lib/vt_api/api/v2/comments.rb', line 12

def date
  @date
end

#date_tokenObject (readonly)

Returns the value of attribute date_token.



12
13
14
# File 'lib/vt_api/api/v2/comments.rb', line 12

def date_token
  @date_token
end

#textObject (readonly)

Returns the value of attribute text.



12
13
14
# File 'lib/vt_api/api/v2/comments.rb', line 12

def text
  @text
end