Class: Obeya::Ticket

Inherits:
Object
  • Object
show all
Defined in:
lib/obeya/ticket.rb

Instance Method Summary collapse

Constructor Details

#initialize(title, description, format, ticket_type, bin) ⇒ Ticket

Returns a new instance of Ticket.



4
5
6
7
8
9
10
# File 'lib/obeya/ticket.rb', line 4

def initialize(title, description, format, ticket_type, bin)
  @title = title
  @description = description
  @format = format
  @ticket_type = ticket_type
  @bin = bin
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
18
19
20
# File 'lib/obeya/ticket.rb', line 12

def to_json
  {
    "name":           @title,
    "rtformat":       @format,
    "description":    normalise(@description),
    "bin_id":         @bin.id,
    "ticketType_id":  @ticket_type.id
  }.to_json
end