Skip to content

Instantly share code, notes, and snippets.

RedDotRubyConf 2016 links & resources
===
📆 Jun 23-24, 2016
🌏 Web site: http://reddotrubyconf.com/ Twitter: http://twitter.com/reddotrubyconf
Credits to [@cheeaun on Twitter](https://twitter.com/cheeaun)
🕙 Previously, on RedDotRubyConf...
@benhawker
benhawker / description_generator.rb
Created April 8, 2016 07:07
Rails Service Class to Auto Generate Descriptions in various locales
module Rooms
class DescriptionGenerator
attr_reader :room, :locale
def initialize(room, locale="en")
@room = room
@locale = locale
end
def generate
@benhawker
benhawker / title_generator.rb
Last active April 8, 2016 07:06
Automatic Description Generator - Rails Service Class for a Property Rental Web App
module Rooms
class TitleGenerator
attr_reader :room, :locale
def initialize(room, locale="en")
@room = room
@locale = locale
end
def generate
@benhawker
benhawker / presenter.rb
Created February 2, 2016 08:37
Rails Presenters example
# Assume you also have the following "general case" presenters
# app/presenters/cancellation_policy_presenter.rb
# app/presenters/daily_price_presenter.rb
# app/presenters/weekly_price_presenter.rb
# Now for some presenter fun..
# app/presenters/room_presenter.rb
class RoomPresenter
# gives you access to RoomPresenter#cancellation_policy (see below)