Class: PkiExpress::ValidationItem
- Inherits:
-
Object
- Object
- PkiExpress::ValidationItem
- Defined in:
- lib/pki_express/validation_item.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#inner_validation_results ⇒ Object
Returns the value of attribute inner_validation_results.
-
#message ⇒ Object
Returns the value of attribute message.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(model) ⇒ ValidationItem
constructor
A new instance of ValidationItem.
- #to_s(indentation_level = 0) ⇒ Object
- #to_str(indentation_level = 0) ⇒ Object
Constructor Details
#initialize(model) ⇒ ValidationItem
Returns a new instance of ValidationItem.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pki_express/validation_item.rb', line 6 def initialize(model) @type = nil = nil @detail = nil @inner_validation_results = nil if model @type = model.fetch(:type) = model.fetch(:message) @detail = model.fetch(:detail) inner_validation_results = model.fetch(:innerValidationResults) if inner_validation_results @inner_validation_results = ValidationResults.new(inner_validation_results) end end end |
Instance Attribute Details
#detail ⇒ Object
Returns the value of attribute detail.
4 5 6 |
# File 'lib/pki_express/validation_item.rb', line 4 def detail @detail end |
#inner_validation_results ⇒ Object
Returns the value of attribute inner_validation_results.
4 5 6 |
# File 'lib/pki_express/validation_item.rb', line 4 def inner_validation_results @inner_validation_results end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/pki_express/validation_item.rb', line 4 def end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/pki_express/validation_item.rb', line 4 def type @type end |
Instance Method Details
#to_s(indentation_level = 0) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pki_express/validation_item.rb', line 28 def to_s(indentation_level=0) tab = "\t" * indentation_level text = tab + if @detail text += " (#{@detail})" end if @inner_validation_results text += "\n" text += @inner_validation_results.to_s(indentation_level + 1) end text end |
#to_str(indentation_level = 0) ⇒ Object
24 25 26 |
# File 'lib/pki_express/validation_item.rb', line 24 def to_str(indentation_level=0) to_s(indentation_level) end |