Class: UIC::Effect

Inherits:
Object
  • Object
show all
Includes:
FileBacked
Defined in:
lib/ruic/effect.rb

Direct Known Subclasses

Application::Effect

Instance Attribute Summary collapse

Attributes included from FileBacked

#file, #file_content

Instance Method Summary collapse

Methods included from FileBacked

#absolute_path, #file_found?, #filename, #relative_path, #save!, #save_as

Constructor Details

#initialize(lua_path) ⇒ Effect

Returns a new instance of Effect.



4
5
6
7
# File 'lib/ruic/effect.rb', line 4

def initialize( lua_path )
	self.file = lua_path
	load_from_file if file_found?
end

Instance Attribute Details

#luaObject (readonly)

Returns the value of attribute lua.



3
4
5
# File 'lib/ruic/effect.rb', line 3

def lua
  @lua
end

Instance Method Details

#errorsObject



16
17
18
# File 'lib/ruic/effect.rb', line 16

def errors
	file_found? ? [] : ["File not found: '#{file}'"]
end

#errors?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ruic/effect.rb', line 12

def errors?
	!errors.empty?
end

#load_from_fileObject



8
9
10
# File 'lib/ruic/effect.rb', line 8

def load_from_file
	@lua = File.read(file,encoding:'utf-8')
end