Class: Antecedent

Inherits:
Object
  • Object
show all
Defined in:
app/models/antecedent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Antecedent

Returns a new instance of Antecedent.



5
6
7
8
9
10
11
# File 'app/models/antecedent.rb', line 5

def initialize(attributes={})
  @ticket = attributes.fetch(:ticket, Ticket.first)
  @reporter = attributes.fetch(:reporter, User.first)
  @created_at = attributes.fetch(:created_at, 1.week.ago)
  @customer = attributes.fetch(:customer, OpenStruct.new(name: "Humphrey Blaughfellow"))
  @notes = attributes.fetch(:notes, "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo volupt")
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



13
14
15
# File 'app/models/antecedent.rb', line 13

def created_at
  @created_at
end

#customerObject (readonly)

Returns the value of attribute customer.



13
14
15
# File 'app/models/antecedent.rb', line 13

def customer
  @customer
end

#notesObject (readonly)

Returns the value of attribute notes.



13
14
15
# File 'app/models/antecedent.rb', line 13

def notes
  @notes
end

#reporterObject (readonly)

Returns the value of attribute reporter.



13
14
15
# File 'app/models/antecedent.rb', line 13

def reporter
  @reporter
end

#ticketObject (readonly)

Returns the value of attribute ticket.



13
14
15
# File 'app/models/antecedent.rb', line 13

def ticket
  @ticket
end