source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | civiccc/buffet | https://github.com/civiccc/buffet | lib/buffet/master.rb | Ruby | mit | 91 | master | 8,927 | require 'benchmark'
require 'drb'
require 'thread'
require 'socket'
module Buffet
class Master
attr_reader :failures, :stats, :slave_exceptions, :spurious_failures
def initialize project, slaves, specs, listener
@project = project
@slaves = slaves
@stats = { :examples => 0, :failures => 0,... |
github | civiccc/buffet | https://github.com/civiccc/buffet | lib/buffet/runner.rb | Ruby | mit | 91 | master | 4,425 | require 'buffet'
require 'colorize'
require 'fileutils'
module Buffet
class Runner
def initialize
@project = Settings.project
end
def run specs = nil
@specs = specs
raise 'No specs found' if @specs.empty?
@slaves = Settings.slaves
raise 'No slaves defined in settings.yml' ... |
github | civiccc/buffet | https://github.com/civiccc/buffet | lib/buffet/cli.rb | Ruby | mit | 91 | master | 1,239 | require 'buffet'
require 'buffet/version'
require 'optparse'
module Buffet
class CLI
def initialize args
opts = OptionParser.new do |opts|
opts.banner = "Usage: buffet [options] [spec-files]"
opts.on('-c', '--config CONFIG',
'Use the specified CONFIG file') do |config_file|... |
github | civiccc/buffet | https://github.com/civiccc/buffet | lib/buffet/slave.rb | Ruby | mit | 91 | master | 1,049 | module Buffet
class Slave
attr_reader :user, :host, :project
def initialize user, host, project
@user = user
@host = host
@project = project
end
def rsync src, dest
Buffet.run! 'rsync', '-aqz', '--delete',
'--delete-excluded', rsync_exclude_flags,
... |
github | civiccc/buffet | https://github.com/civiccc/buffet | lib/buffet/settings.rb | Ruby | mit | 91 | master | 2,512 | require 'yaml'
module Buffet
# Stores configuration settings for Buffet.
class Settings
DEFAULT_LOG_FILE = 'buffet.log'
DEFAULT_SETTINGS_FILE = 'buffet.yml'
DEFAULT_PREPARE_COMMAND = 'bin/before-buffet-run'
DEFAULT_EXCLUDE_FILTER_FILE = '.buffet-exclude-filter'
class << se... |
github | civiccc/buffet | https://github.com/civiccc/buffet | support/rspec2_formatter.rb | Ruby | mit | 91 | master | 1,766 | require 'rspec/core/formatters/base_text_formatter'
module RSpec
module Core
module Formatters
class AugmentedTextFormatter < BaseTextFormatter
def initialize(output)
super(output)
end
def self.configure buffet_server, slave_name
@@buffet_server = buffet_server
... |
github | civiccc/buffet | https://github.com/civiccc/buffet | spec/command_runner_spec.rb | Ruby | mit | 91 | master | 2,721 | require 'spec_helper'
require 'mkdtemp'
describe Buffet::CommandRunner do
let(:log_buffer) { StringIO.new '' }
let(:logger) { Logger.new log_buffer }
let(:runner) { Buffet::CommandRunner.new logger }
context 'with a successful command' do
let(:touch_file) { 'file1' }
before do
Dir.mkdtemp do
... |
github | civiccc/buffet | https://github.com/civiccc/buffet | spec/settings_spec.rb | Ruby | mit | 91 | master | 2,023 | require 'spec_helper'
describe Buffet::Settings do
before do
Buffet::Settings.reset!
end
describe '.[]' do
it 'reads from a Yaml file called "buffet.yml"' do
YAML.should_receive(:load_file).
with('buffet.yml').
and_return({'foo' => 'bar'})
Buffet::Settings['foo'].should == 'b... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | tweaks.rb | Ruby | mit | 91 | master | 59,020 | module Tweaks
def apply_pre_randomization_tweaks
@tiled = TMXInterface.new
game.fix_unnamed_skills()
if GAME == "dos"
# Make the drawbridge stay permanently down once the player has lowered it.
game.apply_armips_patch("dos_drawbridge_stays_down")
# And also modify the le... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizer_window.rb | Ruby | mit | 91 | master | 37,887 | require_relative 'ui_randomizer'
require_relative 'constants/options'
require_relative 'randomizer'
require_relative 'update_checker'
class RandomizerWindow < Qt::Dialog
VALID_SEED_CHARACTERS = "a-zA-Z0-9\\-_'%"
slots "update_settings()"
slots "browse_for_clean_rom()"
slots "browse_for_output_folder()"
sl... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | door_completability_checker.rb | Ruby | mit | 91 | master | 35,947 | require 'yaml'
class DoorCompletabilityChecker < CompletabilityChecker
attr_reader :game,
:current_items,
:return_portraits,
:defs,
:preferences,
:inaccessible_doors,
:progress_important_rooms,
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | completability_checker.rb | Ruby | mit | 91 | master | 15,990 | require 'yaml'
class CompletabilityChecker
attr_reader :game,
:current_items,
:defs,
:preferences,
:inaccessible_doors,
:all_progression_pickups,
:enemy_locations,
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | update_checker.rb | Ruby | mit | 91 | master | 1,295 | require 'net/http'
require 'json'
LATEST_RELEASE_DOWNLOAD_PAGE_URL = "https://github.com/LagoLunatic/dsvrandom/releases/latest"
LATEST_RELEASE_API_URL = "https://api.github.com/repos/lagolunatic/dsvrandom/releases/latest"
def check_for_updates
response = Net::HTTP.get_response(URI(LATEST_RELEASE_API_URL))
if resp... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | dsvrandom.rb | Ruby | mit | 91 | master | 310 | require 'Qt'
require 'fileutils'
require 'yaml'
require_relative '../dsvlib'
require_relative 'version'
require_relative 'randomizer_window'
if defined?(Ocra)
exit
end
Dir.chdir(File.expand_path("..", File.dirname(__FILE__)))
$qApp = Qt::Application.new(ARGV)
window = RandomizerWindow.new
$qApp.exec |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizer.rb | Ruby | mit | 91 | master | 38,499 | require 'digest/md5'
require_relative 'tweaks'
require_relative 'constants/difficulty_options'
require_relative 'completability_checker'
require_relative 'door_completability_checker'
require_relative 'randomizers/pickup_randomizer'
require_relative 'randomizers/enemy_randomizer'
require_relative 'randomizers/drop_ra... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | Rakefile | Ruby | mit | 91 | master | 3,900 | require 'fileutils'
require 'zip'
require 'pathname'
require_relative 'version'
task :build_ui do
# Use rbuic4 to compile the ui files into ruby code.
Dir.glob("*.ui").each do |file_path|
base_name = File.basename(file_path, ".*")
output_path = "ui_%s.rb" % base_name
system "rbuic4 #{base_name}.ui ... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/enemy_anim_speed_randomizer.rb | Ruby | mit | 91 | master | 2,566 | module EnemyAnimSpeedRandomizer
def randomize_enemy_anim_speeds
game.enemy_dnas.each do |enemy_dna|
if enemy_dna.name == "Wallman"
# Wallman can't be defeated if he gets sped up.
next
end
if ["Whip's Memory", "Stella", "Loretta", "Albus"].include?(enemy_dna.name)
# Don't ... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/red_wall_randomizer.rb | Ruby | mit | 91 | master | 3,768 | module RedWallRandomizer
def randomize_red_walls
sprite_info = SpecialObjectType.new(0x49, game.fs).extract_gfx_and_palette_and_sprite_from_create_code
red_walls_image = ChunkyPNG::Image.from_file("./dsvrandom/assets/red wall base sprite.png")
red_wall_palette = ChunkyPNG::Palette.from_canvas(red_walls_im... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/chest_pool_randomizer.rb | Ruby | mit | 91 | master | 2,253 | module ChestPoolRandomizer
def randomize_wooden_chests
return unless GAME == "ooe"
available_rare_wooden_chest_item_ids = [0x77, 0x7A, 0xCB, 0xCC, 0xCD, 0xD0, 0xD1]
available_rare_wooden_chest_item_ids += (0x9C..0xA0).to_a # AP raisers (drops)
available_rare_wooden_chest_item_ids *= 5 # Weight it... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/enemy_randomizer.rb | Ruby | mit | 91 | master | 52,266 | module EnemyRandomizer
MAX_ASSETS_PER_ROOM = 16
RESOURCE_INTENSIVE_ENEMY_NAMES = [
"Forneus",
"Spin Devil",
"Stolas",
"Necromancer",
"Mollusca",
"Giant Slug",
"Invisible Man",
"Quetzalcoatl",
"Ukoback",
"White Dragon",
"Bone Pillar",
"Fish Head",
"Bone Ark",
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/starting_items_randomizer.rb | Ruby | mit | 91 | master | 3,259 | module StartingItemsRandomizer
def select_random_bonus_starting_items
num_bonus_items = @difficulty_settings[:num_bonus_starting_items].round
num_bonus_skills = @difficulty_settings[:num_bonus_starting_skills].round
non_progress_items = all_non_progression_pickups & ITEM_GLOBAL_ID_RANGE.to_a
non_progr... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/world_map_exits_randomizer.rb | Ruby | mit | 91 | master | 9,167 | module WorldMapExitsRandomizer
WORLD_MAP_EXITS = [
#"00-02-1B_000", # Exit from the castle. Don't randomize this, it should always unlock Large Cavern.
"02-00-03_000", # Modified Ecclesia exit
"04-00-03_000",
"05-00-00_000",
"06-00-0A_000",
"06-01-00_000",
"07-00-0E_000",
"08-02-07_000... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/player_randomizer.rb | Ruby | mit | 91 | master | 8,180 | module PlayerRandomizer
def randomize_player_sprites
# First fix the alternate mode characters to use their default attack animations instead of the ones for the main mode characters.
game.apply_armips_patch("dos_fix_alt_character_swing_anims")
game.apply_armips_patch("por_fix_alt_character_swing_anims")
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/boss_randomizer.rb | Ruby | mit | 91 | master | 45,055 | module BossRandomizer
def randomize_bosses
verbose = false
puts "Shuffling bosses:" if verbose
if GAME == "dos"
# The Aguni placed by the boss randomizer does not require Paranoia to reach.
checker.remove_aguni_paranoia_requirement()
end
dos_randomize_final_boss()
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/enemy_stat_randomizer.rb | Ruby | mit | 91 | master | 8,785 | module EnemyStatRandomizer
def randomize_enemy_stats
ENEMY_IDS.each do |enemy_id|
enemy_dna = game.enemy_dnas[enemy_id]
is_boss = BOSS_IDS.include?(enemy_id)
if is_boss
stat_mult_range_name = :boss_stat_mult_range
else
stat_mult_range_name = :enemy_stat_mult_r... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/door_randomizer.rb | Ruby | mit | 91 | master | 60,466 | module DoorRandomizer
class NotAllRoomsAreConnectedError < StandardError ; end
def randomize_transition_doors
queued_door_changes = Hash.new{|h, k| h[k] = {}}
game.areas.each do |area|
all_area_transition_rooms = @transition_rooms.select do |transition_room|
transition_room.area_index ... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/map_randomizer.rb | Ruby | mit | 91 | master | 97,996 | module MapRandomizer
MAX_MAP_WIDTH = 59
MAX_MAP_HEIGHT = 44
DOS_WARP_ROOM_STRS = [
"00-00-18",
"00-01-3E",
"00-02-24",
"00-03-23",
"00-04-17",
"00-05-1E",
"00-05-1F",
"00-06-20",
"00-07-10",
"00-08-21",
"00-09-1F",
"00-0B-23",
]
CONDEMNED_TOWER_ROOM_INDEXES = (0... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/shop_randomizer.rb | Ruby | mit | 91 | master | 3,887 | module ShopRandomizer
def randomize_shop
randomize_item_prices()
available_shop_item_ids = all_non_progression_pickups.select do |item_id|
next unless ITEM_GLOBAL_ID_RANGE.include?(item_id)
item = game.items[item_id]
next if item["Price"].nil?
item["Price"] > 0
end
if... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/item_skill_stat_randomizer.rb | Ruby | mit | 91 | master | 43,827 | module ItemSkillStatRandomizer
def get_n_damage_types(all_damage_types, possible_n_values)
known_damage_type_names = all_damage_types.select{|name| name !~ /\d$/}
num_damage_types = possible_n_values.sample(random: rng)
damage_types_to_set = known_damage_type_names.sample(num_damage_types, random: rng)
... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/starting_room_randomizer.rb | Ruby | mit | 91 | master | 8,862 | module StartingRoomRandomizer
def randomize_starting_room
if GAME == "por"
game.apply_armips_patch("por_fix_top_screen_on_new_game")
end
if GAME == "ooe"
game.apply_armips_patch("ooe_fix_top_screen_on_new_game")
end
rooms = []
if GAME == "por"
area_indexes_of_removed_por... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/drop_randomizer.rb | Ruby | mit | 91 | master | 7,688 | module DropRandomizer
def randomize_enemy_drops
if GAME == "ooe"
[0x67, 0x72, 0x73].each do |enemy_id|
# Boss that has a glyph you can absorb during the fight (Jiang Shi, Albus, and Barlowe).
# Wallman's glyph is not handled here, as that can be a progression glyph.
enemy = ... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/weapon_synth_randomizer.rb | Ruby | mit | 91 | master | 6,277 | module WeaponSynthRandomizer
def randomize_weapon_synths
return unless GAME == "dos"
items_by_type = {}
items_by_type[:weapons] = (0x42..0x90).to_a
items_by_type[:body_armor] = (0x91..0xAE).to_a
items_by_type[:accessories] = (0xAF..0xCD).to_a
# For consumables, we separate different ... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/pickup_randomizer.rb | Ruby | mit | 91 | master | 84,990 | module PickupRandomizer
VILLAGER_NAME_TO_EVENT_FLAG = {
:villagerjacob => 0x2A,
:villagerabram => 0x2D,
:villageraeon => 0x3C,
:villagereugen => 0x38,
:villagermonica => 0x4F,
:villagerlaura => 0x32,
:villagermarcel => 0x40,
:villagerserge => 0x47,
:villageranna => 0x4B,
:villa... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/cosmetic/skill_sprites_randomizer.rb | Ruby | mit | 91 | master | 10,678 | module SkillSpriteRandomizer
def randomize_skill_sprites
skills = game.items[SKILL_GLOBAL_ID_RANGE]
skills_to_randomize = []
all_skill_sprites = {}
all_orig_skill_sprites = {}
weapon_glyph_sprite_indexes = []
remaining_sprite_indexes_by_type = {}
skills.each do |skill|
next if s... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/cosmetic/bgm_randomizer.rb | Ruby | mit | 91 | master | 1,238 | module BgmRandomizer
def randomize_bgm
remaining_song_indexes = BGM_RANDO_AVAILABLE_SONG_INDEXES.dup
remaining_song_indexes.shuffle!(random: rng)
if GAME == "por"
(0..15).each do |bgm_index|
new_song_index = remaining_song_indexes.pop()
game.write_song_index_by_bgm_index(new_son... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/cosmetic/enemy_sprite_randomizer.rb | Ruby | mit | 91 | master | 15,277 | module EnemySpriteRandomizer
def randomize_enemy_sprites
enemy_ids_to_randomize = []
if options[:randomize_enemy_sprites]
enemy_ids_to_randomize += COMMON_ENEMY_IDS
end
if options[:randomize_boss_sprites]
enemy_ids_to_randomize += BOSS_IDS
end
sprite_info_locations_for_enemy =... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | randomizers/cosmetic/dialogue_randomizer.rb | Ruby | mit | 91 | master | 6,280 | module DialogueRandomizer
def randomize_dialogue
markov = Markov.new(rng)
events = game.text_database.text_list[TEXT_REGIONS["Events"]]
intro_text = game.text_database.text_list[INTRO_TEXT_ID]
events -= [intro_text]
library_descriptions = []
if GAME == "dos"
TEXT_REGIONS["Libra... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | constants/difficulty_options.rb | Ruby | mit | 91 | master | 9,976 | DIFFICULTY_OPTION_PRETTY_NAMES = {
:item_stat_label => "<b>Average Item Stats</b>",
:item_price_range => "Item Price",
:weapon_attack_range => "Weapon ATK",
:weapon_iframes_range => "Weapon IFrames",
:armor_defense_range => "Armor DEF",
:item_extr... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | constants/por_randomizer_constants.rb | Ruby | mit | 91 | master | 11,307 | NONRANDOMIZABLE_PICKUP_GLOBAL_IDS =
[0x60, 0xA9, 0xE3, 0x109, 0x126, 0x150, 0x1A1] + # unequip dummy items (---)
[0x12C] + # magus ring (placed separately by the randomizer logic)
[0x4F, 0x50, 0x51] # the hard mode clear rewards that give +50 to certain stats. these make the game too easy
ITEMS_WITH_OP_HARDCODED... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | constants/ooe_randomizer_constants.rb | Ruby | mit | 91 | master | 10,371 | NONRANDOMIZABLE_PICKUP_GLOBAL_IDS =
[0x0, 0x37, 0x50, 0xE5, 0x100, 0x124, 0x139, 0x160] + # unequip dummy items (---)
[0x161] + # unused vampire killer weapon
(0x51..0x6E).to_a + # glyph unions
(0xD7..0xE4).to_a + # no-damage medals
[0xAE, 0xB6, 0xD6] # usable items with a hardcoded effect for quests
ITEMS_W... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | constants/dos_randomizer_constants.rb | Ruby | mit | 91 | master | 9,193 | NONRANDOMIZABLE_PICKUP_GLOBAL_IDS =
[0x42] + # unequip dummy weapon (bare knuckles)
[0xCD] # chaos ring (placed separately by the randomizer logic)
ITEMS_WITH_OP_HARDCODED_EFFECT = []
NONOFFENSIVE_SKILL_NAMES = [
"Puppet Master",
"Zephyr",
"Paranoia",
"Imp",
"Bat Form",
"Flying Armor",
"Bat Company"... |
github | LagoLunatic/dsvrandom | https://github.com/LagoLunatic/dsvrandom | constants/options.rb | Ruby | mit | 91 | master | 6,958 | OPTIONS = {
randomize_pickups: "Randomizes items and skills you find lying on the ground.",
randomize_boss_souls: "Randomizes the souls dropped by bosses as well as Wallman's glyph (DoS/OoE only).",
randomize_world_map_exits: "Randomizes the order areas are unlocked on the world map (OoE only, and the Open World ... |
github | jawerty/btcl | https://github.com/jawerty/btcl | btcl.gemspec | Ruby | mit | 91 | master | 816 | Gem::Specification.new do |s|
s.name = "btcl"
s.version = "0.0.1"
s.summary = "A cli for retrieving prices from Bitcoin exchanges."
s.description = "Follow Bitcoin markets from your terminal. btcl is a Bitcoin Market Price Client that uses bitcoin markets a... |
github | jawerty/btcl | https://github.com/jawerty/btcl | lib/btcl.rb | Ruby | mit | 91 | master | 3,481 | #!/usr/bin/env ruby
require "optparse"
require "open-uri"
require 'net/http'
require "json"
require 'text-table'
#btcl pre-determines thte top btc exchanges
$top = {
"BTC CHINA" => "btcnCNY",
"Mt. Gox USA" => "mtgoxUSD",
"BitStamp" => "bitstampUSD",
"btc-e" => "btceUSD",
"Mt.Gox EUROPE" => "mtgoxEUR",
"Mt.Gox... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | haversine.gemspec | Ruby | mit | 91 | master | 2,339 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: haversine 0.3.2 ruby lib
Gem::Specification.new do |s|
s.name = "haversine".freeze
s.version = "0.3.2"
s.required_rubygems_version = Gem::Requirement.new("... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | Gemfile | Ruby | mit | 91 | master | 393 | source "http://rubygems.org"
# Add dependencies required to use your gem here.
# Example:
# gem "activesupport", ">= 2.3.5"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "rspec", "~> 3.6", ">= 3.6.0"
gem "bundler", ">= 1.3.0"... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | Rakefile | Ruby | mit | 91 | master | 1,819 | require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
include Rake::DSL if defined? Rake::DSL
require 'jeweler'
Jeweler::Tasks.ne... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | lib/haversine.rb | Ruby | mit | 91 | master | 1,242 | #
# Haversine formula to compute the great circle distance between two points given their latitude and longitudes
#
# Notes:
#
# translated into Ruby based on information contained in:
# http://en.wikipedia.org/wiki/Haversine_formula
#
# This formula can compute accurate distances between two points given latitude an... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | lib/haversine/distance.rb | Ruby | mit | 91 | master | 1,417 | module Haversine
class Distance
include Comparable
GREAT_CIRCLE_RADIUS_MILES = 3956
GREAT_CIRCLE_RADIUS_KILOMETERS = 6371 # some algorithms use 6367
GREAT_CIRCLE_RADIUS_FEET = GREAT_CIRCLE_RADIUS_MILES * 5280
GREAT_CIRCLE_RADIUS_METERS = GREAT_CIRCLE_RADIUS_KILOMETERS * 1000
GREAT_CIRCLE_RADI... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | spec/distance_spec.rb | Ruby | mit | 91 | master | 528 | require 'spec_helper'
describe Haversine::Distance do
describe "<=>" do
context "equality" do
it "is true when the great circle distance is equal" do
dist1 = Haversine::Distance.new(0)
dist2 = Haversine::Distance.new(0)
expect(dist1 == dist2).to be(true)
end
it "is fals... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | spec/haversine_spec.rb | Ruby | mit | 91 | master | 1,427 | require 'spec_helper'
describe Haversine do
describe "#self.distance" do
it "returns Haversine::Distance" do
expect(Haversine.distance(0,0,0,0)).to be_a(Haversine::Distance)
end
it "accepts 4 numbers or 2 arrays as arguments" do
new_york_city = [40.71427, -74.00597]
santiago_chile = [-... |
github | kristianmandrup/haversine | https://github.com/kristianmandrup/haversine | spec/spec_helper.rb | Ruby | mit | 91 | master | 413 | $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'haversine'
require 'simplecov'
SimpleCov.start if ENV["COVERAGE"]
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.d... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | mollie-api-ruby.gemspec | Ruby | bsd-2-clause | 91 | master | 1,278 | $LOAD_PATH.push File.expand_path('lib', __dir__)
require 'mollie/version'
Gem::Specification.new do |s|
s.name = 'mollie-api-ruby'
s.version = Mollie::VERSION
s.summary = 'Official Mollie API Client for Ruby'
s.description = %(Accepting iDEAL, Bancontact, SOFORT Banking, Creditcard,
SEPA Ban... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/run-test.rb | Ruby | bsd-2-clause | 91 | master | 391 | #!/usr/bin/env ruby
# From https://github.com/test-unit/test-unit/blob/master/test/run-test.rb
$KCODE = 'utf8' unless ''.respond_to?(:encoding)
base_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
lib_dir = File.join(base_dir, 'lib')
test_dir = File.join(base_dir, 'test')
$LOAD_PATH.unshift(lib_dir)... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/helper.rb | Ruby | bsd-2-clause | 91 | master | 258 | require 'test/unit'
require 'webmock/test_unit'
require 'mollie'
Mollie::Client.configure do |config|
config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM'
end
def read_fixture(path)
File.read(File.join(File.dirname(__FILE__), 'fixtures', path))
end |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/payment_test.rb | Ruby | bsd-2-clause | 91 | master | 21,372 | require 'helper'
module Mollie
class PaymentTest < Test::Unit::TestCase
GET_PAYMENT_WITH_EMBEDDED_RESOURCES = read_fixture('payments/get_embedded_resources.json')
def test_setting_attributes
attributes = {
resource: 'payment',
id: 'tr_7UhSN1zuXS',
mode: 'test',
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/balance_test.rb | Ruby | bsd-2-clause | 91 | master | 4,538 | require "helper"
module Mollie
class BalanceTest < Test::Unit::TestCase
GET_BALANCE = read_fixture('balances/get.json')
GET_BALANCE_REPORT = read_fixture('balances/report.json')
LIST_BALANCES = read_fixture('balances/list.json')
LIST_BALANCE_TRANSACTIONS = read_fixture('balances/list_transactions.jso... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/payment_link_test.rb | Ruby | bsd-2-clause | 91 | master | 4,142 | require "helper"
module Mollie
class PaymentLinkTest < Test::Unit::TestCase
CREATE_PAYMENT_LINK = read_fixture("payment_links/create.json")
GET_PAYMENT_LINK = read_fixture("payment_links/get.json")
UPDATE_PAYMENT_LINK = read_fixture("payment_links/update.json")
LIST_PAYMENT_LINKS = read_fixture("paym... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/util_test.rb | Ruby | bsd-2-clause | 91 | master | 708 | require 'helper'
module Mollie
class UtilTest < Test::Unit::TestCase
def test_extract_id
links = {
'customer' => {
'href' => 'https://api.mollie.com/v2/customers/cst_4qqhO89gsT',
'type' => 'application/hal+json'
}
}
customer_id = Util.extract_id(links, 'cust... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/permission_test.rb | Ruby | bsd-2-clause | 91 | master | 470 | require 'helper'
module Mollie
class PermissionTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'payments.read',
description: 'View your payments',
granted: true
}
permission = Permission.new(attributes)
assert_equal 'paymen... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/refund_test.rb | Ruby | bsd-2-clause | 91 | master | 6,545 | require 'helper'
module Mollie
class RefundTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 're_4qqhO89gsT',
amount: { 'value' => '5.95', 'currency' => 'EUR' },
status: 'pending',
created_at: '2016-10-08T07:59:53.0Z',
des... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/customer_test.rb | Ruby | bsd-2-clause | 91 | master | 1,959 | require 'helper'
module Mollie
class CustomerTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'cst_vsKJpSsabw',
mode: 'test',
name: 'Customer A',
email: 'customer@example.org',
locale: 'nl_NL',
metadata: ... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/amount_test.rb | Ruby | bsd-2-clause | 91 | master | 658 | require 'helper'
module Mollie
class AmountTest < Test::Unit::TestCase
def test_value
amount = Amount.new('value' => '42.10', 'currency' => 'EUR')
assert_equal 0.421e2, amount.value
end
def test_currency
amount = Amount.new('currency' => 'EUR')
assert_equal 'EUR', amount.currency... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/settlement_test.rb | Ruby | bsd-2-clause | 91 | master | 10,194 | require 'helper'
module Mollie
class SettlementTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'stl_jDk30akdN',
reference: '1234567.1511.03',
settled_at: '2015-11-06T06:00:02.0Z',
amount: { 'value' => 39.75, 'currency' => 'EUR' },
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/order_test.rb | Ruby | bsd-2-clause | 91 | master | 12,906 | require 'helper'
module Mollie
class OrderTest < Test::Unit::TestCase
CREATE_ORDER = read_fixture('orders/create.json')
GET_ORDER = read_fixture('orders/get.json')
UPDATE_ORDER = read_fixture('orders/update.json')
LIST_ORDER = read_fixture('orders/list.json')
GET_ORDER_WITH_EMBEDDED_RESOURC... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/organization_test.rb | Ruby | bsd-2-clause | 91 | master | 2,427 | require 'helper'
module Mollie
class OrganizationTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'org_12345678',
name: 'Mollie B.V.',
locale: 'nl_NL',
email: 'info@mollie.com',
addr... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/terminal_test.rb | Ruby | bsd-2-clause | 91 | master | 1,980 | require 'helper'
module Mollie
class TerminalTest < Test::Unit::TestCase
GET_TERMINAL = read_fixture('terminals/get.json')
LIST_TERMINALS = read_fixture('terminals/list.json')
def test_get_terminal
stub_request(:get, "https://api.mollie.com/v2/terminals/term_7MgL4wea46qkRcoTZjWEH")
.to_ret... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/list_test.rb | Ruby | bsd-2-clause | 91 | master | 4,613 | require 'helper'
module Mollie
class ListTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
'_embedded' => { 'payments' => [
{ 'id' => 'tr_1' },
{ 'id' => 'tr_2' }
] },
'count' => 2,
'_links' => {
'self' => {
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/invoice_test.rb | Ruby | bsd-2-clause | 91 | master | 2,243 | require 'helper'
module Mollie
class InvoiceTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'inv_xBEbP9rvAq',
reference: '2016.10000',
vat_number: 'NL001234567B01',
status: 'open',
issued_at: '2016-08-31',
due_at: ... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/partner_test.rb | Ruby | bsd-2-clause | 91 | master | 1,325 | require 'helper'
module Mollie
class PartnerTest < Test::Unit::TestCase
def setup
stub_request(:get, 'https://api.mollie.com/v2/organizations/me/partner')
.to_return(status: 200, body: read_fixture('organizations/partner.json'), headers: {})
end
def test_class_type
partner = Partner.... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/method_test.rb | Ruby | bsd-2-clause | 91 | master | 2,579 | require 'helper'
module Mollie
class MethodTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'creditcard',
description: 'Credit card',
minimum_amount: { value: '0.01', currency: 'EUR' },
maximum_amount: { value: '2000.00', currency: 'EUR' },... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/profile_test.rb | Ruby | bsd-2-clause | 91 | master | 6,607 | require 'helper'
module Mollie
class ProfileTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'pfl_v9hTwCvYqw',
mode: 'live',
name: 'My website name',
website: 'https://www.mywebsite.com',
email:... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/onboarding_test.rb | Ruby | bsd-2-clause | 91 | master | 1,995 | require 'helper'
module Mollie
class OnboardingTest < Test::Unit::TestCase
def test_get_onboarding
stub_request(:get, 'https://api.mollie.com/v2/onboarding/me')
.to_return(status: 200, body: read_fixture('onboarding/me.json'), headers: {})
onboarding = Onboarding.me
assert_equal 'Molli... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/client_test.rb | Ruby | bsd-2-clause | 91 | master | 6,640 | require 'helper'
module Mollie
class ClientTest < Test::Unit::TestCase
def client
Mollie::Client.new('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM')
end
def test_initialize
assert_equal 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM', client.api_key
end
def test_setting_the_api_endpoint
client ... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/chargeback_test.rb | Ruby | bsd-2-clause | 91 | master | 3,305 | require 'helper'
module Mollie
class ChargebackTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 're_4qqhO89gsT',
amount: { 'value' => '5.95', 'currency' => 'EUR' },
created_at: '2016-10-08T07:59:53.0Z',
reversed_at: '2016-10-08T07:59:... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/base_test.rb | Ruby | bsd-2-clause | 91 | master | 6,521 | require 'helper'
module Mollie
class TestObject < Base
attr_accessor :id, :foo, :my_field
class NestedObject < Base
attr_accessor :id, :testobject_id, :foo
end
end
class BaseTest < Test::Unit::TestCase
def test_resource_name
assert_equal 'testobjects', TestObject.resource_name
e... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/exception_test.rb | Ruby | bsd-2-clause | 91 | master | 3,151 | require 'helper'
module Mollie
class ExceptionTest < Test::Unit::TestCase
def test_attributes
stub_request(:post, 'https://api.mollie.com/v2/payments')
.to_return(status: 422, headers: { "Content-Type" => "application/hal+json}" }, body: %(
{
"status": 422,
"ti... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/order/create_payment_test.rb | Ruby | bsd-2-clause | 91 | master | 592 | require 'helper'
module Mollie
class Order
class PaymentTest < Test::Unit::TestCase
CREATE_PAYMENT = read_fixture("orders/create_payment.json")
def test_create_payment
stub_request(:post, "https://api.mollie.com/v2/orders/ord_kEn1PlbGa/payments")
.to_return(status: 201, body: CREAT... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/order/shipment_test.rb | Ruby | bsd-2-clause | 91 | master | 5,931 | require 'helper'
module Mollie
class Order
class ShipmentTest < Test::Unit::TestCase
GET_ORDER = read_fixture('orders/get.json')
GET_SHIPMENT = read_fixture('shipments/get.json')
CREATE_SHIPMENT = read_fixture('shipments/create.json')
LIST_SHIPMENTS = read_fixture('shipments/lis... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/order/line_test.rb | Ruby | bsd-2-clause | 91 | master | 2,302 | require 'helper'
module Mollie
class Order
class LineTest < Test::Unit::TestCase
GET_ORDER = read_fixture('orders/get.json')
CANCEL_LINE = read_fixture('orders/cancel_line.json')
CANCEL_QTY = read_fixture('orders/cancel_line_qty.json')
UPDATE_LINE = read_fixture('orders/update_line.jso... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/customer/payment_test.rb | Ruby | bsd-2-clause | 91 | master | 669 | require 'helper'
module Mollie
class Customer
class PaymentTest < Test::Unit::TestCase
def test_kind_of_payment
payment = Mollie::Customer::Payment.new({})
assert_kind_of Mollie::Payment, payment
end
def test_list_payments
stub_request(:get, 'https://api.mollie.com/v2/c... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/customer/mandate_test.rb | Ruby | bsd-2-clause | 91 | master | 4,230 | require 'helper'
module Mollie
class Customer
class MandateTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'mdt_h3gAaD5zP',
mode: 'test',
status: 'valid',
method: 'creditcard',
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/customer/subscription_test.rb | Ruby | bsd-2-clause | 91 | master | 6,647 | require 'helper'
module Mollie
class Customer
class SubscriptionTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: 'sub_rVKGtNd6s3',
customer_id: 'cst_stTC2WHAuS',
mode: 'live',
created_at: '2016-06-01T12:23:34.0Z'... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/payment/chargeback_test.rb | Ruby | bsd-2-clause | 91 | master | 629 | require 'helper'
module Mollie
class Payment
class ChargebackTest < Test::Unit::TestCase
def test_kind_of_refund
chargeback = Mollie::Payment::Chargeback.new({})
assert_kind_of Mollie::Chargeback, chargeback
end
def test_list_chargebacks
stub_request(:get, 'https://api.... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/payment/capture_test.rb | Ruby | bsd-2-clause | 91 | master | 3,481 | require 'helper'
module Mollie
class Payment
class CaptureTest < Test::Unit::TestCase
GET_CAPTURE = read_fixture('captures/get.json')
LIST_CAPTURES = read_fixture('captures/list.json')
PAYMENT_STUB = %({ "resource": "payment", "id": "tr_WDqYK6vllg" }).freeze
SHIPMENT_STUB = %({ "res... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/payment/refund_test.rb | Ruby | bsd-2-clause | 91 | master | 586 | require 'helper'
module Mollie
class Payment
class RefundTest < Test::Unit::TestCase
def test_kind_of_refund
refund = Mollie::Payment::Refund.new({})
assert_kind_of Mollie::Refund, refund
end
def test_list_refunds
stub_request(:get, 'https://api.mollie.com/v2/payments/p... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/balance/transaction_test.rb | Ruby | bsd-2-clause | 91 | master | 1,400 | require 'helper'
module Mollie
class Balance
class TransactionTest < Test::Unit::TestCase
def test_setting_attributes
attributes = {
id: "baltr_QM24QwzUWR4ev4Xfgyt29A",
type: "refund",
result_amount: { "value" => "-10.25", "currency" => "EUR" },
initial_amoun... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/settlement/chargeback_test.rb | Ruby | bsd-2-clause | 91 | master | 657 | require 'helper'
module Mollie
class Settlement
class ChargebackTest < Test::Unit::TestCase
def test_kind_of_chargeback
chargeback = Mollie::Settlement::Chargeback.new({})
assert_kind_of Mollie::Chargeback, chargeback
end
def test_list_chargebacks
stub_request(:get, 'ht... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/settlement/payment_test.rb | Ruby | bsd-2-clause | 91 | master | 681 | require 'helper'
module Mollie
class Settlement
class PaymentTest < Test::Unit::TestCase
def test_kind_of_payment
payment = Mollie::Settlement::Payment.new({})
assert_kind_of Mollie::Payment, payment
end
def test_list_payments
stub_request(:get, 'https://api.mollie.com/... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | test/mollie/settlement/refund_test.rb | Ruby | bsd-2-clause | 91 | master | 600 | require 'helper'
module Mollie
class Settlement
class RefundTest < Test::Unit::TestCase
def test_kind_of_refund
refund = Mollie::Settlement::Refund.new({})
assert_kind_of Mollie::Refund, refund
end
def test_list_refunds
stub_request(:get, 'https://api.mollie.com/v2/sett... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie.rb | Ruby | bsd-2-clause | 91 | master | 1,301 | require 'json'
require 'time'
require 'ostruct'
require 'bigdecimal'
require 'net/https'
module Mollie
end
require 'mollie/exception'
require 'mollie/util'
require 'mollie/version'
require 'mollie/base'
require 'mollie/amount'
require 'mollie/balance'
require 'mollie/chargeback'
require 'mollie/client'
require 'moll... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/invoice.rb | Ruby | bsd-2-clause | 91 | master | 1,661 | module Mollie
class Invoice < Base
STATUS_OPEN = 'open'.freeze
STATUS_PAID = 'paid'.freeze
STATUS_OVERDUE = 'overdue'.freeze
class Line < Base
attr_accessor :period, :description, :count, :vat_percentage, :amount
def amount=(amount)
@amount = Mollie::Amount.new(amount)
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/chargeback.rb | Ruby | bsd-2-clause | 91 | master | 1,226 | module Mollie
class Chargeback < Base
attr_accessor :id,
:payment,
:amount,
:settlement_amount,
:created_at,
:payment_id,
:reversed_at,
:_links
alias links _links
def reversed?
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/settlement.rb | Ruby | bsd-2-clause | 91 | master | 1,962 | module Mollie
class Settlement < Base
STATUS_OPEN = 'open'.freeze
STATUS_PENDING = 'pending'.freeze
STATUS_PAIDOUT = 'paidout'.freeze
STATUS_FAILED = 'failed'.freeze
attr_accessor :id,
:reference,
:created_at,
:settled_at,
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/profile.rb | Ruby | bsd-2-clause | 91 | master | 2,487 | module Mollie
class Profile < Base
CATEGORY_CODE_GENERAL_MERCHANDISE = 5399
CATEGORY_CODE_ELECTRONICS_COMPUTERS_AND_SOFTWARE = 5732
CATEGORY_CODE_TRAVEL_RENTAL_AND_TRANSPORTATION = 4121
CATEGORY_CODE_FINANCIAL_SERVICES = 6012
CATEGORY_CODE_FOOD_AND_DRINKS ... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/customer.rb | Ruby | bsd-2-clause | 91 | master | 706 | module Mollie
class Customer < Base
attr_accessor :id,
:mode,
:name,
:email,
:locale,
:metadata,
:created_at
def created_at=(created_at)
@created_at = Time.parse(created_at.to_s)
end
def... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/amount.rb | Ruby | bsd-2-clause | 91 | master | 337 | module Mollie
class Amount < Base
attr_accessor :value, :currency
def initialize(attributes)
super unless attributes.nil?
end
def value=(val)
@value = BigDecimal(val.to_s)
end
def to_h
{
value: attributes['value'],
currency: attributes['currency']
}
... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/partner.rb | Ruby | bsd-2-clause | 91 | master | 1,207 | module Mollie
class Partner < Base
attr_accessor :partner_type,
:is_commission_partner,
:partner_contract_signed_at,
:partner_contract_update_available,
:_links
attr_reader :user_agent_tokens
alias links _links
def self.current... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/terminal.rb | Ruby | bsd-2-clause | 91 | master | 1,372 | module Mollie
class Terminal < Base
STATUS_PENDING = "pending".freeze
STATUS_ACTIVE = "active".freeze
STATUS_INACTIVE = "inactive".freeze
attr_accessor :id,
:profile_id,
:status,
:brand,
:model,
:serial_n... |
github | mollie/mollie-api-ruby | https://github.com/mollie/mollie-api-ruby | lib/mollie/base.rb | Ruby | bsd-2-clause | 91 | master | 2,465 | module Mollie
class Base
attr_reader :attributes
def initialize(attributes)
@attributes = attributes
assign_attributes(attributes)
end
def assign_attributes(attributes)
attributes.each do |key, value|
public_send("#{key}=", value) if respond_to?("#{key}=")
end
end... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.