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.
138 139 140 141 142 143 144 |
# File 'lib/hocon/impl/tokens.rb', line 138 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
177 178 179 180 181 182 |
# File 'lib/hocon/impl/tokens.rb', line 177 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
173 174 175 |
# File 'lib/hocon/impl/tokens.rb', line 173 def can_equal(other) other.is_a?(Problem) end |
#cause ⇒ Object
158 159 160 |
# File 'lib/hocon/impl/tokens.rb', line 158 def cause @cause end |
#hash ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/hocon/impl/tokens.rb', line 184 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
150 151 152 |
# File 'lib/hocon/impl/tokens.rb', line 150 def @message end |
#suggest_quotes ⇒ Object
154 155 156 |
# File 'lib/hocon/impl/tokens.rb', line 154 def suggest_quotes @suggest_quotes end |
#to_s ⇒ Object
162 163 164 165 166 167 168 169 170 171 |
# File 'lib/hocon/impl/tokens.rb', line 162 def to_s sb = StringIO.new sb << "'" sb << what sb << "'" sb << " (" sb << sb << ")" sb.string end |
#what ⇒ Object
146 147 148 |
# File 'lib/hocon/impl/tokens.rb', line 146 def what @what end |