Module: Nem::Configuration

Included in:
Nem
Defined in:
lib/nem/configuration.rb

Constant Summary collapse

DEADLINE =

1 hour

3600

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



7
8
9
# File 'lib/nem/configuration.rb', line 7

def debug
  @debug
end

#default_deadlineObject

Returns the value of attribute default_deadline.



7
8
9
# File 'lib/nem/configuration.rb', line 7

def default_deadline
  @default_deadline
end

#default_networkObject

Returns the value of attribute default_network.



7
8
9
# File 'lib/nem/configuration.rb', line 7

def default_network
  @default_network
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/nem/configuration.rb', line 7

def logger
  @logger
end

Class Method Details

.extended(base) ⇒ Object



11
12
13
14
15
16
# File 'lib/nem/configuration.rb', line 11

def self.extended(base)
  base.logger = Logger.new($stdout).tap { |l| l.level = Logger::INFO }
  base.debug = false
  base.default_deadline = DEADLINE
  base.default_network = :testnet
end

Instance Method Details

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

Examples:

Nem.configure do |conf|
  conf.logger = Logger.new('path/to/nem-ruby.log')
  conf.logger.level = Logger::DEBUG
  conf.default_deadline = 7200
  conf.default_network = :mainnet
end

Yields:

  • (self)


26
27
28
# File 'lib/nem/configuration.rb', line 26

def configure
  yield self
end