Class: Straightedge::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/straightedge/motor/engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(surface_geometry = Straightedge.config.geometry) ⇒ Engine

Returns a new instance of Engine.



4
5
6
7
8
# File 'lib/straightedge/motor/engine.rb', line 4

def initialize(surface_geometry=Straightedge.config.geometry)
  @agent   = Straightedge.new_agent
  @surface = Straightedge.new_surface(surface_geometry)
  @adapter = Straightedge.new_adapter(agent: @agent, plane: @surface)
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



3
4
5
# File 'lib/straightedge/motor/engine.rb', line 3

def adapter
  @adapter
end

#agentObject (readonly)

Returns the value of attribute agent.



3
4
5
# File 'lib/straightedge/motor/engine.rb', line 3

def agent
  @agent
end

#surfaceObject (readonly)

Returns the value of attribute surface.



3
4
5
# File 'lib/straightedge/motor/engine.rb', line 3

def surface
  @surface
end

Instance Method Details

#bootObject



10
11
12
# File 'lib/straightedge/motor/engine.rb', line 10

def boot
  @adapter.kickstart
end