Class: Contactology::Issue
- Inherits:
-
Object
- Object
- Contactology::Issue
- Defined in:
- lib/contactology/issue.rb
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#deduction ⇒ Object
readonly
Returns the value of attribute deduction.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(details) ⇒ Issue
constructor
A new instance of Issue.
- #to_s ⇒ Object
Constructor Details
#initialize(details) ⇒ Issue
Returns a new instance of Issue.
12 13 14 15 16 17 18 19 20 |
# File 'lib/contactology/issue.rb', line 12 def initialize(details) details = Hash.new unless details.kind_of?(Hash) @type = details['type'] @text = details['text'] @message = details['message'] @context = details['context'] @col = details['col'] @deduction = details['deduction'] || 0 end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
9 10 11 |
# File 'lib/contactology/issue.rb', line 9 def col @col end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/contactology/issue.rb', line 8 def context @context end |
#deduction ⇒ Object (readonly)
Returns the value of attribute deduction.
10 11 12 |
# File 'lib/contactology/issue.rb', line 10 def deduction @deduction end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/contactology/issue.rb', line 7 def @message end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/contactology/issue.rb', line 6 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/contactology/issue.rb', line 5 def type @type end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/contactology/issue.rb', line 22 def to_s "%s: %s, %d point deduction" % [type, text || , deduction] end |