Class: Teapot::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/teapot/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Name

Returns a new instance of Name.



23
24
25
# File 'lib/teapot/name.rb', line 23

def initialize(text)
	@text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



27
28
29
# File 'lib/teapot/name.rb', line 27

def text
  @text
end

Instance Method Details

#identifierObject



29
30
31
# File 'lib/teapot/name.rb', line 29

def identifier
	@identifier ||= @text.gsub(/\s+/, '')
end

#macroObject



37
38
39
# File 'lib/teapot/name.rb', line 37

def macro
	@guard ||= @text.upcase.gsub(/\s+/, '_')
end

#targetObject



33
34
35
# File 'lib/teapot/name.rb', line 33

def target
	@target ||= @text.gsub(/\s+/, '-').downcase
end