Class: ValidationFailure
Constant Summary
Constants included
from Inspectable
Inspectable::INSPECTING_KEY
Instance Attribute Summary collapse
Instance Method Summary
collapse
#initialize
#==
#inspect
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
213
214
215
|
# File 'lib/json_patterns.rb', line 213
def path
@path
end
|
Instance Method Details
#path_to_s ⇒ Object
222
223
224
|
# File 'lib/json_patterns.rb', line 222
def path_to_s
'$' + @path.map { |p| "[#{ p.is_a?(String) ? "'#{p.to_s}'" : p.to_s }]" }.join('')
end
|
#to_json ⇒ Object
215
216
217
218
219
220
|
# File 'lib/json_patterns.rb', line 215
def to_json
Hash[*self.instance_variables.map { |var|
val = self.instance_variable_get(var)
[var.to_s.sub('@', ''), (val.is_a?(Set) ? val.to_a : val)]
}.reduce(:+)]
end
|