Module: Taro::Types::Shared::Name

Defined in:
lib/taro/types/shared/name.rb

Instance Method Summary collapse

Instance Method Details

#define_name(name) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/taro/types/shared/name.rb', line 2

def define_name(name)
  instance_eval(<<~RUBY, __FILE__, __LINE__ + 1)
    def name
      #{name.inspect}
    end
    alias to_s name

    def inspect
      "#<#{name}>"
    end
  RUBY
end