Class: RestPki::ValidationItem

Inherits:
Object
  • Object
show all
Defined in:
lib/rest_pki/validation_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#detailObject (readonly)

Returns the value of attribute detail.



4
5
6
# File 'lib/rest_pki/validation_item.rb', line 4

def detail
  @detail
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/rest_pki/validation_item.rb', line 4

def message
  @message
end

#typeObject (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_stringObject



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