Class: CommentElement

Inherits:
Object
  • Object
show all
Defined in:
lib/jirarest2/services/comment.rb

Overview

One single Comment TODO Maybe rewrite the initalize and then get a few other parameters like the issue-id or the comment-id

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author, text, cdate = Time.now, mdate = Time.now) ⇒ CommentElement

create one instance of an Comment

Parameters:

  • author (String)

    (Last) author of the comment

  • text (String)

    Text of the comment

  • cdate (Time, String) (defaults to: Time.now)

    Creation date of the comment

  • mdate (Time, String) (defaults to: Time.now)

    Date of last change to the comment



45
46
47
48
49
50
51
52
53
# File 'lib/jirarest2/services/comment.rb', line 45

def  initialize(author,text,cdate = Time.now,mdate = Time.now)
  @author = author
  @text = text
  #  parse time if needed
  cdate = Time.parse(cdate) if cdate.instance_of?(String)
  @cdate = cdate
  mdate = Time.parse(mdate) if mdate.instance_of?(String)
  @mdate = mdate
end

Instance Attribute Details

#authorString (readonly)

The author of the comment

Returns:

  • (String)


29
30
31
# File 'lib/jirarest2/services/comment.rb', line 29

def author
  @author
end

#cdateTime (readonly)

creation date

Returns:

  • (Time)


35
36
37
# File 'lib/jirarest2/services/comment.rb', line 35

def cdate
  @cdate
end

#mdateTime (readonly)

last modify date

Returns:

  • (Time)


38
39
40
# File 'lib/jirarest2/services/comment.rb', line 38

def mdate
  @mdate
end

#textString (readonly)

text of the comment

Returns:

  • (String)


32
33
34
# File 'lib/jirarest2/services/comment.rb', line 32

def text
  @text
end