Class: Lignite::SystemCommands

Inherits:
Object
  • Object
show all
Extended by:
Logger
Includes:
Bytes, Logger
Defined in:
lib/lignite/system_commands.rb

Overview

The commands that cannot appear in a .rbf program, used mostly for program manipulation

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logger

default_logger, logger

Methods included from Bytes

#bin_to_hex, #f32, #hex_to_bin, #u16, #u32, #u8, #unpack_f32, #unpack_u16, #unpack_u32, #unpack_u8

Constructor Details

#initialize(conn = Connection.create) ⇒ SystemCommands

Returns a new instance of SystemCommands.

Parameters:

  • conn (Connection) (defaults to: Connection.create)


16
17
18
19
# File 'lib/lignite/system_commands.rb', line 16

def initialize(conn = Connection.create)
  @conn = conn
  load_yml
end

Class Method Details

.run(conn = Connection.create, &block) ⇒ Object



9
10
11
12
13
# File 'lib/lignite/system_commands.rb', line 9

def self.run(conn = Connection.create, &block)
  sc = new(conn)
  sc.instance_exec(&block)
  sc.close
end

Instance Method Details

#closeObject



21
22
23
# File 'lib/lignite/system_commands.rb', line 21

def close
  @conn.close
end