Sha256: 85afb8b32429828b74f7204e61fba944c160c165650d6fd3dcfa869195b959a2

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

require 'active_support/core_ext/module/delegation'

class Module

  def delegate_property *properties
    options = {}
    methods = []

    properties.each do |options_or_property|
      if options_or_property.is_a? Hash
        options.merge! options_or_property
      else
        methods << options_or_property
        methods << "#{options_or_property.to_s}="
      end
    end
    puts methods
    puts options

    delegate *methods, options
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simply_useful-0.2.0 lib/simply_useful/core_ext/module/property_delegation.rb