module ButlerMainframe

These modules contain extensions for the Host class

These modules contain extensions for the Host class

These modules contain extensions for the Host class

This class use Rocket 3270 emulator API www.zephyrcorp.com/legacy-integration/Documentation/passport_host_integration_objects.htm

This class use IBM personal communication www-01.ibm.com/support/knowledgecenter/SSEQ5Y_6.0.0/welcome.html www-01.ibm.com/support/knowledgecenter/SSEQ5Y_6.0.0/com.ibm.pcomm.doc/books/html/host_access08.htm www-01.ibm.com/support/knowledgecenter/SSEQ5Y_6.0.0/com.ibm.pcomm.doc/books/html/admin_guide10.htm?lang=en

This class use X3270, an interesting project open source x3270.bgp.nu/Windows/wc3270-script.html x3270.bgp.nu/Windows/ws3270-man.html

Public Class Methods

configuration() click to toggle source
# File lib/core/configuration.rb, line 20
def self.configuration
  @configuration ||= Configuration.new
end
configuration=(config) click to toggle source
# File lib/core/configuration.rb, line 24
def self.configuration=(config)
  @configuration = config
end
configure() { |configuration| ... } click to toggle source
# File lib/core/configuration.rb, line 28
def self.configure
  yield configuration
end
root() click to toggle source
# File lib/butler-mainframe.rb, line 13
def self.root
  File.expand_path('../..', __FILE__)
end

Public Instance Methods

configure_on_the_fly(&block) click to toggle source

And we define a wrapper for the configuration block, that we'll use to set up our set of options

# File lib/core/configuration_dynamic.rb, line 29
def configure_on_the_fly(&block)
  instance_eval &block
end
parameter(*names) click to toggle source

Appdata provides a basic single-method DSL with .parameter method being used to define a set of available settings. This method takes one or more symbols, with each one being a name of the configuration option.

# File lib/core/configuration_dynamic.rb, line 13
def parameter(*names)
  names.each do |name|
    attr_accessor name

    # For each given symbol we generate accessor method that sets option's
    # value being called with an argument, or returns option's current value
    # when called without arguments
    define_method name do |*values|
      value = values.first
      value ? self.send("#{name}=", value) : instance_variable_get("@#{name}")
    end
  end
end