Skip to content

Instantly share code, notes, and snippets.

@tatey
Forked from nathanaelkane/ruby_example.rb
Last active December 11, 2015 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatey/4628934 to your computer and use it in GitHub Desktop.
Save tatey/4628934 to your computer and use it in GitHub Desktop.
class RubyExample
CONSTANT = /^[0-9]+ regex awesomes$/
attr_reader :colorscheme
def initialize(attributes = {})
@colorscheme = attributes[:colorscheme]
end
def self.values
# Bacon ipsum dolor sit amet
['string', :symbol, true, false, nil, 99.9, 1..2, {:key => :value}].each do |value|
puts "#{value.inspect} is a #{value.class}"
end
end
private
def heredoc_example
<<-HEREDOC.strip_heredoc
_ ___ ______ __
| | / (_)___ ___ / ____/___ / /___ __________
| | / / / __ `__ \ / / / __ \/ / __ \/ ___/ ___/
| |/ / / / / / / / / /___/ /_/ / / /_/ / / (__ )
|___/_/_/ /_/ /_/ \____/\____/_/\____/_/ /____/
HEREDOC
end
def 19hash
{key: 'value'}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment