Sha256: a304b5e86f86913929630ecac5932e6d5884a48bac9302c721f54e841a7bd30d

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module UnrealReaper
  module PackageObjExt
    class << self
      def included(cls)
        return if cls.method_defined?(:obj)
        cls.class_eval do
          attr_reader :obj, :options
        end
      end
      alias prepended included
    end

    def initialize(obj, opts)
      @obj = obj
      @options = opts

      if method(__method__).super_method.arity == 0
        super()
      else
        super
      end
    end

    def _write(data)
      data.each do |attr_name, val|
        self.send("#{attr_name}=", val)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unreal_reaper-0.1.0 lib/unreal_reaper/package_obj_ext.rb