Class: Hocon::Impl::Parseable::ParseableString
Overview
NOTE: skipping ‘ParseableReader` until we know we need it (probably should
have done that with `ParseableNotFound`)
Constant Summary
MAX_INCLUDE_DEPTH
Instance Method Summary
collapse
#content_type, #fixup_options, force_parsed_to_object, #guess_syntax, #include_context, new_file, new_not_found, new_resources, new_string, #options, #origin, #parse, #parse_config_document, #parse_document, #parse_document_from_origin, #parse_value, #parse_value_from_origin, #post_construct, #raw_parse_document, #raw_parse_document_from_io, #raw_parse_value, #raw_parse_value_from_io, #reader, relative_to, #relative_to, syntax_from_extension, trace
#options, #origin, #parse
Constructor Details
#initialize(string, options) ⇒ ParseableString
Returns a new instance of ParseableString.
356
357
358
359
360
|
# File 'lib/hocon/impl/parseable.rb', line 356
def initialize(string, options)
super()
@input = string
post_construct(options)
end
|
Instance Method Details
#custom_reader ⇒ Object
362
363
364
365
366
367
368
369
|
# File 'lib/hocon/impl/parseable.rb', line 362
def custom_reader
if Hocon::Impl::ConfigImpl.trace_loads_enabled
self.class.trace("Loading config from a String: #{@input}")
end
self
end
|
#open ⇒ Object
371
372
373
374
375
376
377
378
379
|
# File 'lib/hocon/impl/parseable.rb', line 371
def open
if block_given?
StringIO.open(@input) do |f|
yield f
end
else
StringIO.open(@input)
end
end
|
#to_s ⇒ Object
385
386
387
|
# File 'lib/hocon/impl/parseable.rb', line 385
def to_s
"#{self.class.name.split('::').last} (#{@input})"
end
|