Sha256: c05b737f3f053c0374689e6cf26b9d4dda5d45e34fcf048e077906ca88254a05

Contents?: true

Size: 1.45 KB

Versions: 107

Compression:

Stored size: 1.45 KB

Contents

module OrigenTesters
  module IGXLBasedTester
    class Base
      class PatsetPattern
        ALIASES = {
          pattern: :file_name
        }

        def self.define
          # Generate accessors for all attributes and their aliases
          self::PATSET_ATTRS.each do |attr|
            writer = "#{attr}=".to_sym
            reader = attr.to_sym
            attr_reader attr.to_sym unless method_defined? reader
            attr_writer attr.to_sym unless method_defined? writer
          end

          ALIASES.each do |_alias, val|
            writer = "#{_alias}=".to_sym
            reader = _alias.to_sym
            unless method_defined? writer
              define_method("#{_alias}=") do |v|
                send("#{val}=", v)
              end
            end
            unless method_defined? reader
              define_method("#{_alias}") do
                send(val)
              end
            end
          end
        end

        def initialize(patset, attrs = {})
          # Set the defaults
          self.class::PATSET_DEFAULTS.each do |k, v|
            send("#{k}=", v)
          end
          # Then the values that have been supplied
          self.pattern_set = patset
          attrs.each do |k, v|
            send("#{k}=", v)
          end
        end

        def to_s
          l = "\t"
          self.class::PATSET_ATTRS.each do |attr|
            l += "#{send(attr)}\t"
          end
          "#{l}"
        end
      end
    end
  end
end

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
origen_testers-0.49.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.48.3 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.48.2 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.48.1 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.48.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.47.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.46.1 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.46.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.45.4 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.45.3 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.45.2 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.45.1 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.45.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.44.1 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.44.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.43.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.42.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.41.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.40.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb
origen_testers-0.31.0 lib/origen_testers/igxl_based_tester/base/patset_pattern.rb