Class: Bade::Runtime::Location

Inherits:
Struct
  • Object
show all
Defined in:
lib/bade/runtime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



5
6
7
# File 'lib/bade/runtime.rb', line 5

def label
  @label
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



5
6
7
# File 'lib/bade/runtime.rb', line 5

def lineno
  @lineno
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



5
6
7
# File 'lib/bade/runtime.rb', line 5

def path
  @path
end

Instance Method Details

#template?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/bade/runtime.rb', line 6

def template?
  path == TEMPLATE_FILE_NAME || path&.include?('.bade')
end

#to_sObject



10
11
12
# File 'lib/bade/runtime.rb', line 10

def to_s
  "#{path || TEMPLATE_FILE_NAME}:#{lineno}:in `#{label}'"
end