Module: Nps

Extended by:
Nps
Included in:
Nps
Defined in:
lib/nps.rb,
lib/nps/ballot.rb,
lib/nps/survey.rb,
lib/nps/version.rb,
lib/nps/calculator.rb,
lib/nps/configuration.rb

Defined Under Namespace

Classes: Ballot, Calculator, Configuration, Survey

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



12
13
14
# File 'lib/nps.rb', line 12

def configuration
  @configuration
end

Instance Method Details

#configure {|configuration| ... } ⇒ Object

Public: Set custom configuration options such as how to store the NPS votes.

Examples:

Nps.configure do |config|
  config.ballot_adaptor = YourBallotAdaptor
end

Yields:



22
23
24
25
# File 'lib/nps.rb', line 22

def configure
  self.configuration ||= Nps::Configuration.new
  yield(configuration) if block_given?
end