class DTK::ErrorNotFound
Attributes
obj_type[R]
obj_value[R]
Public Class Methods
new(obj_type=nil,obj_value=nil)
click to toggle source
# File lib/errors/errors.rb, line 105 def initialize(obj_type=nil,obj_value=nil) @obj_type = obj_type @obj_value = obj_value end
Public Instance Methods
to_hash()
click to toggle source
# File lib/errors/errors.rb, line 118 def to_hash() if obj_type.nil? {:error => :NotFound} elsif obj_value.nil? {:error => {:NotFound => {:type => @obj_type}}} else {:error => {:NotFound => {:type => @obj_type, :value => @obj_value}}} end end
to_s()
click to toggle source
# File lib/errors/errors.rb, line 109 def to_s() if obj_type.nil? "NotFound error:" elsif obj_value.nil? "NotFound error: type = #{@obj_type.to_s}" else "NotFound error: #{@obj_type.to_s} = #{@obj_value.to_s}" end end