This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%title Example HAML | |
/[if IE] | |
%link{ :rel => "stylesheet", :href => "/css/ie.css" } | |
%body | |
#container | |
%header | |
%h1 Our Awesome HTML5 Template |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
def self.included( base ) | |
base.send :extend, ClassMethods | |
base.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def metodo_de_clase | |
puts 'Método de clase' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StringCalculator | |
CUSTOM_DELIMITER_REGEXP = Regexp.new("\/\/(\\D)\\n") | |
CUSTOM_LONG_DELIMITER_REGEXP = Regexp.new("\/\/\\[(([^\\]|\\D])+)\\]\\n") | |
MULTIPLE_DELIMITERS_REGEXP = Regexp.new("\/\/(\\[.*\\])\\n") | |
def add(operation) | |
if operation == '' | |
return 0 | |
end |
NewerOlder