Class: Mj::Git::PullRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/mj/git/pull_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number:, title:, state:, updated_at:, author:) ⇒ PullRequest

Returns a new instance of PullRequest.



12
13
14
15
16
17
18
# File 'lib/mj/git/pull_request.rb', line 12

def initialize(number:, title:, state:, updated_at:, author:)
  @number = number
  @title = title
  @state = state
  @updated_at = updated_at
  @author = author
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



8
9
10
# File 'lib/mj/git/pull_request.rb', line 8

def author
  @author
end

#numberObject (readonly)

Returns the value of attribute number.



6
7
8
# File 'lib/mj/git/pull_request.rb', line 6

def number
  @number
end

#stateObject (readonly)

Returns the value of attribute state.



9
10
11
# File 'lib/mj/git/pull_request.rb', line 9

def state
  @state
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/mj/git/pull_request.rb', line 7

def title
  @title
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



10
11
12
# File 'lib/mj/git/pull_request.rb', line 10

def updated_at
  @updated_at
end

Instance Method Details

#closed?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/mj/git/pull_request.rb', line 20

def closed?
  state == "MERGED" || state == "CLOSED"
end