Contents:
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 ReservationHelper | |
def show_advanced_num_people_fields?(reservation) | |
show_num_people_senior?(reservation) || | |
show_num_people_child?(reservation) || | |
show_num_people_baby?(reservation) | |
end | |
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 ReservationService | |
class CustomError < StandardError; end | |
def initialize(options = {}) | |
add_logic_here | |
end | |
def validate! | |
raise CustomError unless valid? | |
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
require 'net/http' | |
class HttpRequestService | |
attr_reader :uri | |
def do_post(url, headers, data) | |
set_uri(url) | |
post = build_post(uri, headers, data) | |
net_http(uri).start { |http| http.request(post) } | |
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 OutlookCalendarService | |
APP_ID = your_app_id | |
APP_SECRET = your_app_secret | |
LOGIN_API_DOMAIN = 'https://login.microsoftonline.com' | |
AUTHORIZE_PATH = '/common/oauth2/v2.0/authorize' | |
TOKEN_PATH = '/common/oauth2/v2.0/token' | |
CALENDAR_API_DOMAIN = 'https://outlook.office365.com' | |
VERSION_PATH = '/api/v2.0' |
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
#!/bin/ruby | |
class CavityFinder | |
def initialize(grid) | |
@grid = grid | |
end | |
def cavities | |
cavities = [] | |
i = 1 |
A Ruby static code analyzer, based on the community Ruby style guide.
Title | Link |
---|---|
Github | https://github.com/rubocop-hq/rubocop |
Docs | http://rubocop.readthedocs.io/en/latest/ |
Ruby Style Guide | https://github.com/rubocop-hq/ruby-style-guide |
External links:
API Url:
OlderNewer