Class: Throttle::Client
- Inherits:
-
Object
- Object
- Throttle::Client
- Includes:
- Bandwidth
- Defined in:
- lib/throttle/client.rb
Instance Method Summary collapse
Methods included from Bandwidth
Instance Method Details
#limit(bandwidth) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/throttle/client.rb', line 21 def limit(bandwidth) Pipe.reset = { :id => 1, :bandwidth => parse_bandwidth(bandwidth) } Pipe.new().set status end |
#reset ⇒ Object
16 17 18 19 |
# File 'lib/throttle/client.rb', line 16 def reset Pipe.reset status end |
#status ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/throttle/client.rb', line 5 def status pipes = Pipe.all status = "" pipes.each do |p| status += "#{p.bandwidth}" end status = "No Limits." if status.empty? return status end |