Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View post.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class Post
def initialize(params)
@params = params
end
 
def safe_title
make_safe @params[:title]
end
 
def make_safe(str)
str.gsub(/[^\w]/, '-')
end
end
 
new_post = Post.new('title' => 'new post', 'body' => 'your text here')
puts new_post.safe_title
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.