Class: Labelito::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/Labelito/label.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, color) ⇒ Label

Returns a new instance of Label.



6
7
8
9
# File 'lib/Labelito/label.rb', line 6

def initialize(name, color)
  @name = name
  @color = color
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



4
5
6
# File 'lib/Labelito/label.rb', line 4

def color
  @color
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/Labelito/label.rb', line 4

def name
  @name
end

Class Method Details

.from_github_label(label) ⇒ Object



11
12
13
# File 'lib/Labelito/label.rb', line 11

def self.from_github_label(label)
  return Label.new label[:name], label[:color] if label[:name] && label[:color]
end