Class: Prdigest::PullRequest

Inherits:
Data
  • Object
show all
Defined in:
lib/prdigest/digest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository:, number:, title:, url:, author:, merged_at:, additions: nil, deletions: nil, commits: nil) ⇒ PullRequest

Returns a new instance of PullRequest.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/prdigest/digest.rb', line 10

def initialize(repository:, number:, title:, url:, author:, merged_at:, additions: nil, deletions: nil, commits: nil)
  super(
    repository: repository.to_s.freeze,
    number: Integer(number),
    title: title.to_s.freeze,
    url: url.to_s.freeze,
    author: author.to_s.freeze,
    merged_at: merged_at.utc.freeze,
    additions: additions && Integer(additions),
    deletions: deletions && Integer(deletions),
    commits: commits && Integer(commits)
  )
end

Instance Attribute Details

#additionsObject (readonly)

Returns the value of attribute additions

Returns:

  • (Object)

    the current value of additions



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def additions
  @additions
end

#authorObject (readonly)

Returns the value of attribute author

Returns:

  • (Object)

    the current value of author



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def author
  @author
end

#commitsObject (readonly)

Returns the value of attribute commits

Returns:

  • (Object)

    the current value of commits



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def commits
  @commits
end

#deletionsObject (readonly)

Returns the value of attribute deletions

Returns:

  • (Object)

    the current value of deletions



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def deletions
  @deletions
end

#merged_atObject (readonly)

Returns the value of attribute merged_at

Returns:

  • (Object)

    the current value of merged_at



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def merged_at
  @merged_at
end

#numberObject (readonly)

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def number
  @number
end

#repositoryObject (readonly)

Returns the value of attribute repository

Returns:

  • (Object)

    the current value of repository



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def repository
  @repository
end

#titleObject (readonly)

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



6
7
8
# File 'lib/prdigest/digest.rb', line 6

def url
  @url
end