Sha256: 5df13ff5ef30a5d24e6b61c42581f796a18d15feac64c2580b2269de3a665aa8
Contents?: true
Size: 756 Bytes
Versions: 13
Compression:
Stored size: 756 Bytes
Contents
# frozen_string_literal: true require 'luna_park/entities/attributable' module LunaPark module Entities # add description class Nested < Attributable def self.namespace(name, &block) # rubocop:disable Metrics/MethodLength serializable_attributes(name) comparable_attributes(name) namespace_class = Class.new(Nested) namespace_class.define_singleton_method(:name) { "Namespace:#{name}" } namespace_class.class_eval(&block) anonym_mixin = Module.new do attr_reader(name) define_method(:"#{name}=") do |input| instance_variable_set(:"@#{name}", namespace_class.wrap(input)) end end include(anonym_mixin) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems