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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'u-case' | |
gem 'pry' | |
end | |
class Sum < Micro::Case | |
attributes :a, :b |
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 "active_record" | |
require "sqlite3" | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:host => "localhost", | |
:database => ':memory:' | |
) | |
ActiveRecord::Schema.define do |
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 ContractTemplates | |
module Update | |
class TryCreateRevision < Micro::Case | |
attributes :company, :params | |
def call! | |
return Success(:skipped_contract_revision) unless term_changed? | |
ContractRevision.create!(contract_revision_params) |
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
def on(arg, spec) | |
track, result = arg.to_a[0] | |
type, data = result.to_a[0] | |
hook = spec.fetch(track, {})[type] | |
return unless hook | |
keys = hook.parameters.map(&:last) |
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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'awesome_print' | |
gem 'pry' | |
gem 'u-case', '~> 4.0.0' | |
gem 'activemodel', '~> 6.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
require 'bundler/inline' | |
require 'digest' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'u-attributes', '~> 2.6.0' | |
end | |
class Password | |
include Micro::Attributes.with(:initialize) |
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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'u-test' | |
gem 'activerecord', require: 'active_record' | |
gem 'sqlite3' | |
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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'u-case' | |
gem 'u-observers' | |
end | |
class Person | |
include Micro::Observers |
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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'u-attributes', '~> 2.6.0' | |
end | |
# ------------------- ------------------- | |
class Person |
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 Words1 | |
def self.foo; "foo1"; end | |
def self.bar; "bar1"; end | |
end | |
module Words2 | |
extend self | |
private |