Sha256: bfd40e2bcf500d972e191c4df9abdb983bba7a67afda727d248ca2bc2df76a3d

Contents?: true

Size: 865 Bytes

Versions: 7

Compression:

Stored size: 865 Bytes

Contents

module TE3270
  module ScreenPopulator

    #
    # This method will populate all matched screen text fields from the
    # Hash passed as an argument.  The way it find an element is by
    # matching the Hash key to the name you provided when declaring
    # the text field on your screen.
    #
    # @example
    #   class ExampleScreen
    #     include TE3270
    #
    #     text_field(:username, 1, 2, 20)
    #   end
    #
    #   ...
    #
    #   @emulator = TE3270::emulator_for :quick3270
    #   example_screen = ExampleScreen.new(@emulator)
    #   example_screen.populate_screen_with :username => 'a name'
    #
    # @param [Hash] hsh the data to use to populate this screen.
    #
    def populate_screen_with(hsh)
      hsh.each do |key, value|
        self.send("#{key}=", value) if self.respond_to? "#{key}=".to_sym
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
te3270-0.9.0 lib/te3270/screen_populator.rb
te3270-0.8.1 lib/te3270/screen_populator.rb
te3270-0.8.0 lib/te3270/screen_populator.rb
te3270-0.7.1 lib/te3270/screen_populator.rb
te3270-0.7.0 lib/te3270/screen_populator.rb
te3270-0.6.0 lib/te3270/screen_populator.rb
te3270-0.5.0-x86_64-darwin-14 lib/te3270/screen_populator.rb