Class: Hocon::Impl::Parseable::ParseableString

Inherits:
Hocon::Impl::Parseable show all
Defined in:
lib/hocon/impl/parseable.rb

Instance Method Summary collapse

Methods inherited from Hocon::Impl::Parseable

force_parsed_to_object, #guess_syntax, #include_context, new_file, new_string, #options, #parse, #parse_value

Constructor Details

#initialize(string, options) ⇒ ParseableString

Returns a new instance of ParseableString.



43
44
45
46
# File 'lib/hocon/impl/parseable.rb', line 43

def initialize(string, options)
  @input = string
  post_construct(options)
end

Instance Method Details

#create_originObject



48
49
50
# File 'lib/hocon/impl/parseable.rb', line 48

def create_origin
  Hocon::Impl::SimpleConfigOrigin.new_simple("String")
end

#openObject



56
57
58
59
60
61
62
63
64
# File 'lib/hocon/impl/parseable.rb', line 56

def open
  if block_given?
    StringIO.open(@input) do |f|
      yield f
    end
  else
    StringIO.open(@input)
  end
end

#readerObject



52
53
54
# File 'lib/hocon/impl/parseable.rb', line 52

def reader
  self
end