This file contains 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
# RSpec Unit Template | |
describe Model do | |
# Factories | |
describe "has facttories" do | |
it "model factory" do | |
end | |
it "another model factory" do |
This file contains 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 App | |
class Root | |
def call env | |
[ 200, { 'Content-Type' => 'text/html' }, ["root page"] ] | |
end | |
end | |
class Info |
This file contains 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 'google/api_client' # version 0.7.1 | |
# Set purchase data hash | |
data = { | |
token: 'gldfdkfjpnnhmnclekpndgph.AO-J1OwXKIzAKUzprnFnNTClSoe7AYx4kF6_d5IujRI7jiTUIHMwQq0oV_fXyjMXf3sUzpCaS0lUWXvqpraR5Pp5Fmk4MvN7CbGDU0lgAg_kqvKDgT1A9y6C3mpBjYBLPN64plT78M-V', | |
productId: 'chebucks18', | |
packageName: 'com.snegoffon.corruption' | |
} | |
# Initialize client |
This file contains 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 MyModule | |
@EXTENSION = [ | |
'one', | |
'two' | |
] | |
@one: -> | |
do @hello | |
This file contains 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
# code_1 | |
class Point | |
end | |
# puts Point.new | |
# code_1.1 |
This file contains 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 IPTracker | |
class IP | |
include Comparable | |
# Количество секунд, после которого игроки | |
# с одинаковым IP считаются разными | |
TIMESTAMP_LIMIT = 86400 |
This file contains 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 Indicator < ActiveRecord::Base | |
include CorruptionResponder | |
include CorruptionIncrement | |
include CorruptionDecrement | |
include PartnerShip | |
include GiveUnit | |
PARAM_NAMES = %w{attack defence health energy clashes} |
This file contains 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 'active_support/all' | |
module Gears | |
class Base | |
private_class_method :new | |
def initialize *methods | |
attrs = methods.extract_options! | |
self.class_eval{ attr_accessor *attrs.keys } |
This file contains 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 Ship | |
attr_accessor :name | |
def construct name = 'Andromeda' | |
@name = name | |
end | |
end |
This file contains 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
def reverse(string) | |
# gets (input from STDIN) isn't necessary cause you get string argument in this method | |
# input = gets.strip | |
# You should split your string by empty string to get an array of it's chars | |
string_array = string.split('') | |
# Class name should be started from a capital letter | |
new_word = Array.new |
OlderNewer