Class: Vetinari::Dcc::Server
- Inherits:
-
Object
- Object
- Vetinari::Dcc::Server
- Includes:
- Celluloid
- Defined in:
- lib/vetinari/dcc/server.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, filepath, filename, server_manager) ⇒ Server
constructor
A new instance of Server.
- #inspect ⇒ Object
- #run(port) ⇒ Object
Constructor Details
#initialize(user, filepath, filename, server_manager) ⇒ Server
Returns a new instance of Server.
8 9 10 11 12 13 14 |
# File 'lib/vetinari/dcc/server.rb', line 8 def initialize(user, filepath, filename, server_manager) @user = user @filepath = filepath @filename = filename @server_manager = server_manager @state = :idling end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
6 7 8 |
# File 'lib/vetinari/dcc/server.rb', line 6 def filepath @filepath end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/vetinari/dcc/server.rb', line 6 def state @state end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/vetinari/dcc/server.rb', line 6 def user @user end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/vetinari/dcc/server.rb', line 22 def inspect "#<Server @user=#{@user.inspect} @filepath=#{filepath}" end |
#run(port) ⇒ Object
16 17 18 19 20 |
# File 'lib/vetinari/dcc/server.rb', line 16 def run(port) @port = port register_resume_callback start end |