Sha256: 767d502e7df5e940fcd935c44f3e4198b1bad283d298264b825e877f4e37a568

Contents?: true

Size: 243 Bytes

Versions: 5

Compression:

Stored size: 243 Bytes

Contents

# frozen_string_literal: true

module LazyRecord
  # Apply the same namespace nesting as self to another object.
  module Nesting
    def apply_nesting(class_name)
      "#{to_s.split('::')[0..-3].join('::')}::#{class_name}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lazy_record-0.6.3 lib/lazy_record/nesting.rb
lazy_record-0.6.2 lib/lazy_record/nesting.rb
lazy_record-0.6.1 lib/lazy_record/nesting.rb
lazy_record-0.6.0 lib/lazy_record/nesting.rb
lazy_record-0.5.0 lib/lazy_record/nesting.rb