Class: Hocon::Impl::Parseable::ParseableFile
Instance Method Summary
collapse
force_parsed_to_object, #include_context, new_file, new_string, #options, #parse, #parse_value
Constructor Details
#initialize(file_path, options) ⇒ ParseableFile
Returns a new instance of ParseableFile.
14
15
16
17
|
# File 'lib/hocon/impl/parseable.rb', line 14
def initialize(file_path, options)
@input = file_path
post_construct(options)
end
|
Instance Method Details
#guess_syntax ⇒ Object
19
20
21
|
# File 'lib/hocon/impl/parseable.rb', line 19
def guess_syntax
Hocon::Impl::Parseable.syntax_from_extension(File.basename(@input))
end
|
#open ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'lib/hocon/impl/parseable.rb', line 31
def open
if block_given?
File.open(@input) do |f|
yield f
end
else
File.open(@input)
end
end
|
#reader ⇒ Object
27
28
29
|
# File 'lib/hocon/impl/parseable.rb', line 27
def reader
self
end
|