Class: SlowBlink::SchemaBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/slow_blink/schema_buffer.rb

Overview

Use SchemaBuffer when you want to deal named in-memory schemas

e.g:

  anonBuffer = SchemaBuffer.new("Hello/0 -> string greeting")
  namedBuffer = SchemaBuffer.new("Hello/0 -> string greeting", "nameThatWillAppearInErrorMessage.txt")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buffer, filename = nil) ⇒ SchemaBuffer

Create a SchemaBuffer

Parameters:

  • buffer (String)

    the contents of the file

  • filename (String) (defaults to: nil)

    name of the file (for error reporting)



46
47
48
49
# File 'lib/slow_blink/schema_buffer.rb', line 46

def initialize(buffer, filename=nil)
    @filename = filename
    @buffer = buffer
end

Instance Attribute Details

#bufferString (readonly)

Returns:

  • (String)


35
36
37
# File 'lib/slow_blink/schema_buffer.rb', line 35

def buffer
  @buffer
end

#filenameString (readonly)

Returns:

  • (String)


38
39
40
# File 'lib/slow_blink/schema_buffer.rb', line 38

def filename
  @filename
end