Class: Hocon::Impl::Tokens::Problem
Instance Method Summary collapse
- #==(other) ⇒ Object
- #can_equal(other) ⇒ Object
- #cause ⇒ Object
- #hash ⇒ Object
-
#initialize(origin, what, message, suggest_quotes, cause) ⇒ Problem
constructor
A new instance of Problem.
- #message ⇒ Object
- #suggest_quotes ⇒ Object
- #to_s ⇒ Object
- #what ⇒ Object
Constructor Details
#initialize(origin, what, message, suggest_quotes, cause) ⇒ Problem
Returns a new instance of Problem.
137 138 139 140 141 142 143 |
# File 'lib/hocon/impl/tokens.rb', line 137 def initialize(origin, what, , suggest_quotes, cause) super(TokenType::PROBLEM, origin) @what = what @message = @suggest_quotes = suggest_quotes @cause = cause end |
Instance Method Details
#==(other) ⇒ Object
176 177 178 179 180 181 |
# File 'lib/hocon/impl/tokens.rb', line 176 def ==(other) super(other) && other.what == @what && other. == @message && other.suggest_quotes == @suggest_quotes && Hocon::Impl::ConfigImplUtil.equals_handling_nil?(other.cause, @cause) end |
#can_equal(other) ⇒ Object
172 173 174 |
# File 'lib/hocon/impl/tokens.rb', line 172 def can_equal(other) other.is_a?(Problem) end |
#cause ⇒ Object
157 158 159 |
# File 'lib/hocon/impl/tokens.rb', line 157 def cause @cause end |
#hash ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/hocon/impl/tokens.rb', line 183 def hash hashcode = 41 * (41 + super) hashcode = 41 * (hashcode + @what.hash) hashcode = 41 * (hashcode + @message.hash) hashcode = 41 * (hashcode + @suggest_quotes.hash) unless @cause.nil? hashcode = 41 * (hashcode + @cause.hash) end hashcode end |
#message ⇒ Object
149 150 151 |
# File 'lib/hocon/impl/tokens.rb', line 149 def @message end |
#suggest_quotes ⇒ Object
153 154 155 |
# File 'lib/hocon/impl/tokens.rb', line 153 def suggest_quotes @suggest_quotes end |
#to_s ⇒ Object
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/hocon/impl/tokens.rb', line 161 def to_s sb = StringIO.new sb << "'" sb << what sb << "'" sb << " (" sb << sb << ")" sb.string end |
#what ⇒ Object
145 146 147 |
# File 'lib/hocon/impl/tokens.rb', line 145 def what @what end |