Exception: DTK::ErrorNotFound
Constant Summary
Constants inherited from Error
DTK::Error::CallerOffset, DTK::Error::DefaultCallerDepth
Instance Attribute Summary collapse
-
#obj_type ⇒ Object
readonly
Returns the value of attribute obj_type.
-
#obj_value ⇒ Object
readonly
Returns the value of attribute obj_value.
Instance Method Summary collapse
-
#initialize(obj_type = nil, obj_value = nil) ⇒ ErrorNotFound
constructor
A new instance of ErrorNotFound.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(obj_type = nil, obj_value = nil) ⇒ ErrorNotFound
Returns a new instance of ErrorNotFound.
105 106 107 108 |
# File 'lib/errors/errors.rb', line 105 def initialize(obj_type=nil,obj_value=nil) @obj_type = obj_type @obj_value = obj_value end |
Instance Attribute Details
#obj_type ⇒ Object (readonly)
Returns the value of attribute obj_type.
104 105 106 |
# File 'lib/errors/errors.rb', line 104 def obj_type @obj_type end |
#obj_value ⇒ Object (readonly)
Returns the value of attribute obj_value.
104 105 106 |
# File 'lib/errors/errors.rb', line 104 def obj_value @obj_value end |
Instance Method Details
#to_hash ⇒ Object
118 119 120 121 122 123 124 125 126 |
# 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 ⇒ Object
109 110 111 112 113 114 115 116 117 |
# 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 |