Module: Walnut

Defined in:
lib/walnut/shell.rb,
lib/walnut.rb,
lib/walnut/events.rb,
lib/walnut/version.rb,
lib/walnut/configuration.rb,
lib/walnut/input/readline.rb,
lib/walnut/output/standard.rb

Overview

Copyright © 2013, Autumn Perrault, Matthew Carey All rights reserved. Distributed under the terms of the MIT license (see LICENSE.md).

Defined Under Namespace

Modules: Input, Output Classes: Configuration, Events, Shell

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



51
52
53
# File 'lib/walnut/configuration.rb', line 51

def self.[](key)
  self.config.send(key)
end

.[]=(key, value) ⇒ Object



55
56
57
# File 'lib/walnut/configuration.rb', line 55

def self.[]=(key, value)
  self.config.send(key.to_s << "=", value)
end

.configWalnut::Configuration

Make a globally accessible configuration that general configuration will go

Examples:

Walnut.config.setting = true
#=> #<Walnut::Configuration setting=true>

Returns:

Author:

  • noxgirl

  • swarley



46
47
48
49
# File 'lib/walnut/configuration.rb', line 46

def self.config
  # Ensure we have the same object every time.
  @walnut_global_configuration||=Configuration.new
end

.configure {|Walnut.config| ... } ⇒ Object

Yields:



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

def self.configure
  yield Walnut.config if block_given?
end

.evObject

Setup events in Walnut as ev.



8
9
10
# File 'lib/walnut/events.rb', line 8

def self.ev
 @walnut_events ||= Walnut::Events.new 
end