Class: Antecedent
- Inherits:
-
Object
- Object
- Antecedent
- Defined in:
- app/models/antecedent.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Antecedent
constructor
A new instance of Antecedent.
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_at ⇒ Object (readonly)
Returns the value of attribute created_at.
13 14 15 |
# File 'app/models/antecedent.rb', line 13 def created_at @created_at end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
13 14 15 |
# File 'app/models/antecedent.rb', line 13 def customer @customer end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
13 14 15 |
# File 'app/models/antecedent.rb', line 13 def notes @notes end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
13 14 15 |
# File 'app/models/antecedent.rb', line 13 def reporter @reporter end |
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
13 14 15 |
# File 'app/models/antecedent.rb', line 13 def ticket @ticket end |