Class: RestPki::ValidationItem
- Inherits:
-
Object
- Object
- RestPki::ValidationItem
- Defined in:
- lib/rest_pki/validation_item.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #__to_string ⇒ Object
-
#initialize(model) ⇒ ValidationItem
constructor
A new instance of ValidationItem.
- #to_string(indentation_level) ⇒ Object
Constructor Details
#initialize(model) ⇒ ValidationItem
Returns a new instance of ValidationItem.
6 7 8 9 10 11 12 13 14 |
# File 'lib/rest_pki/validation_item.rb', line 6 def initialize(model) @type = model['type'] @message = model['message'] @detail = model['detail'] @inner_validation_results = nil unless model['innerValidationResults'].nil? @inner_validation_results = RestPki::ValidationResults.new(model['innerValidationResults']) end end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
4 5 6 |
# File 'lib/rest_pki/validation_item.rb', line 4 def detail @detail end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/rest_pki/validation_item.rb', line 4 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/rest_pki/validation_item.rb', line 4 def type @type end |
Instance Method Details
#__to_string ⇒ Object
16 17 18 |
# File 'lib/rest_pki/validation_item.rb', line 16 def __to_string to_string(0) end |
#to_string(indentation_level) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rest_pki/validation_item.rb', line 20 def to_string(indentation_level) text = '' text += @message unless @detail.to_s.blank? text += " (#{@detail})" end unless @inner_validation_results.nil? text += '\n' text += @inner_validation_results.to_string(indentation_level + 1) end text end |