Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/genit/extensions/string_extension.rb

Instance Method Summary collapse

Instance Method Details

#force_html_extensionObject



5
6
7
# File 'lib/genit/extensions/string_extension.rb', line 5

def force_html_extension
  self.gsub /(markdown|haml)$/, 'html'
end

#force_html_extension!Object



9
10
11
# File 'lib/genit/extensions/string_extension.rb', line 9

def force_html_extension!
  self.gsub! /(markdown|haml)$/, 'html'
end

#haml_ext?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/genit/extensions/string_extension.rb', line 17

def haml_ext?
  self.end_with?('.haml')
end

#markdown_ext?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/genit/extensions/string_extension.rb', line 13

def markdown_ext?
  self.end_with?('.markdown')
end