Class: Ghub::Models::Links

Inherits:
Struct
  • Object
show all
Defined in:
lib/ghub/models/links.rb

Overview

Defines a set of links.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLinks

Returns a new instance of Links.



21
22
23
24
# File 'lib/ghub/models/links.rb', line 21

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#commentsObject

Returns the value of attribute comments

Returns:

  • (Object)

    the current value of comments



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def comments
  @comments
end

#commitsObject

Returns the value of attribute commits

Returns:

  • (Object)

    the current value of commits



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def commits
  @commits
end

#htmlObject

Returns the value of attribute html

Returns:

  • (Object)

    the current value of html



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def html
  @html
end

#issueObject

Returns the value of attribute issue

Returns:

  • (Object)

    the current value of issue



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def issue
  @issue
end

#review_commentObject

Returns the value of attribute review_comment

Returns:

  • (Object)

    the current value of review_comment



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def review_comment
  @review_comment
end

#review_commentsObject

Returns the value of attribute review_comments

Returns:

  • (Object)

    the current value of review_comments



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def review_comments
  @review_comments
end

#selfObject

Returns the value of attribute self

Returns:

  • (Object)

    the current value of self



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def self
  @self
end

#statusesObject

Returns the value of attribute statuses

Returns:

  • (Object)

    the current value of statuses



6
7
8
# File 'lib/ghub/models/links.rb', line 6

def statuses
  @statuses
end

Class Method Details

.for(**attributes) ⇒ Object



16
17
18
19
# File 'lib/ghub/models/links.rb', line 16

def self.for(**attributes)
  attributes.reduce({}) { |collection, (key, value)| collection.merge key => Link[**value] }
            .then { |updates| new(**updates) }
end