Class: HornOfPlenty::Models::Card

Inherits:
Object
  • Object
show all
Includes:
Parsable
Defined in:
lib/horn_of_plenty/models/card.rb

Instance Attribute Summary

Attributes included from Parsable

#parser

Instance Method Summary collapse

Methods included from Parsable

included, #initialize

Instance Method Details

#labelsObject



22
23
24
# File 'lib/horn_of_plenty/models/card.rb', line 22

def labels
  @labels || []
end

#statusObject



26
27
28
# File 'lib/horn_of_plenty/models/card.rb', line 26

def status
  @status || nil
end

#to_hObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/horn_of_plenty/models/card.rb', line 30

def to_h
  {
    id:           id,
    lane_id:      lane_id,
    repository:   repository,
    status:       status,
    content_type: content_type,
    content_id:   content_id,
    title:        title,
    description:  description,
    labels:       labels,
    created_at:   created_at,
    updated_at:   updated_at,
  }
end

#to_shaObject



46
47
48
# File 'lib/horn_of_plenty/models/card.rb', line 46

def to_sha
  @sha ||= Digest::SHA2.hexdigest(to_h.to_s)
end