Class: Rgot::PB

Inherits:
Object
  • Object
show all
Defined in:
lib/rgot/pb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bn: nil) ⇒ PB

Ruby-2.0.0 wants default value of keyword_argument

Raises:

  • (ArgumentError)


6
7
8
9
# File 'lib/rgot/pb.rb', line 6

def initialize(bn: nil)
  raise ArgumentError, "missing keyword: bn" unless bn
  @bn = bn
end

Instance Attribute Details

#bnObject

Returns the value of attribute bn.



3
4
5
# File 'lib/rgot/pb.rb', line 3

def bn
  @bn
end

Instance Method Details

#nextObject



11
12
13
# File 'lib/rgot/pb.rb', line 11

def next
  (0 < @bn).tap { @bn -= 1 }
end