Class: LinearApi::Label
- Inherits:
-
Object
- Object
- LinearApi::Label
- Defined in:
- lib/linear_api/label.rb
Overview
Represents a Linear label
Constant Summary collapse
- LIST_QUERY =
<<~GRAPHQL query ListLabels($teamId: String!) { team(id: $teamId) { labels { nodes { id name color description } } } } GRAPHQL
- CREATE_MUTATION =
<<~GRAPHQL mutation CreateLabel($input: IssueLabelCreateInput!) { issueLabelCreate(input: $input) { success issueLabel { id name color description } } } GRAPHQL
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(data) ⇒ Label
constructor
A new instance of Label.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Label
Returns a new instance of Label.
37 38 39 40 41 42 43 |
# File 'lib/linear_api/label.rb', line 37 def initialize(data) @raw = data @id = data['id'] @name = data['name'] @color = data['color'] @description = data['description'] end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
35 36 37 |
# File 'lib/linear_api/label.rb', line 35 def color @color end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
35 36 37 |
# File 'lib/linear_api/label.rb', line 35 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
35 36 37 |
# File 'lib/linear_api/label.rb', line 35 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/linear_api/label.rb', line 35 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
35 36 37 |
# File 'lib/linear_api/label.rb', line 35 def raw @raw end |
Instance Method Details
#to_h ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/linear_api/label.rb', line 45 def to_h { id: id, name: name, color: color, description: description } end |