Class: Commission

Inherits:
Object
  • Object
show all
Includes:
ArgumentProcessor
Defined in:
lib/commission.rb

Direct Known Subclasses

Free, OptionsHouse

Defined Under Namespace

Classes: Free, OptionsHouse, OptionsHouseAlt

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArgumentProcessor

#process_args

Constructor Details

#initialize(args = {}) ⇒ Commission

Returns a new instance of Commission.



6
7
8
9
10
11
12
13
14
15
# File 'lib/commission.rb', line 6

def initialize(args = {})
  if instance_of? Commission
    raise ArgumentError, "Commission cannot be instantiated"
  end

  process_args(args)

  @shares ||= 0
  @contracts ||= 0
end

Instance Attribute Details

#contractsObject

Returns the value of attribute contracts.



4
5
6
# File 'lib/commission.rb', line 4

def contracts
  @contracts
end

#sharesObject

Returns the value of attribute shares.



4
5
6
# File 'lib/commission.rb', line 4

def shares
  @shares
end