Skip to content

@ConradIrwin /post.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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.