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 'rspec', '~> 3.10' | |
| gem 'activesupport', require: 'active_support/all' | |
| end | |
| module Calc |
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
| # frozen_string_literal: true | |
| module Micro::Attributes | |
| module FormObject | |
| module ClassMethods | |
| def empty | |
| instance = self.allocate | |
| instance.send(:attributes=, Kind::Empty::HASH) | |
| instance | |
| 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
| rgb = [5, 55, 255] | |
| def rgb_to_hex(r, g, b) | |
| '#%02x%02x%02x' % [r, g, b] | |
| end | |
| p rgb # [5, 55, 255] | |
| p rgb_to_hex(*rgb) # "#0537ff" |
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_relative 'a_ext' | |
| module Goals | |
| class BuildMonthDistributionFlow < Micro::Case | |
| include Constants[ | |
| :SumGoalsDaysAtPeriod, :ValidateDailyDistribution, :ValidatePeriodDistribution, | |
| :BuildPeriodsAndDaysByDailyWeight, :BuildPeriodsAndDaysByPeriodWeight | |
| ].from(Goals::Cases::Monthly) | |
| attributes :periods, :goal |
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 'kind' | |
| gem 'u-case' | |
| gem 'activemodel' | |
| gem 'pry' | |
| 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
| # https://github.com/serradura/u-observers/blob/main/README.pt-BR.md | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'u-observers' | |
| 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 Calc | |
| module Outputs | |
| class InMemory | |
| attr_reader :history | |
| def initialize | |
| @history = [] | |
| end | |
| def puts(value) |
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 'faraday' | |
| gem 'async-http-faraday' | |
| gem 'pry' | |
| 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 'benchmark-ips', '~> 2.8', '>= 2.8.4' | |
| gem 'dry-types', '~> 1.5', '>= 1.5.1' | |
| gem 'kind', '~> 5.4' | |
| 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 'base64' | |
| require 'openssl' | |
| require 'singleton' | |
| require 'forwardable' | |
| class AES256 | |
| class Config | |
| class << self | |
| attr_accessor :key | |
| end |