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
# frozen_string_literal: true | |
require 'rails_helper' | |
require 'app/services/doc_gen/application_merge_tag_recipe' | |
describe DocGen::ApplicationMergeTagRecipe do | |
describe '#call' do | |
let(:account) { Fabricate.create(:account) } | |
let(:loan) { FactoryBot.create(:loan, account: account, team: account.team, liability: liability) } |
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
namespace :foo do | |
desc "Removes all bars for a given foo"\ | |
" Example: bundle exec rake foo:remove_bars[2]" | |
task :remove_bars, [:foo_id] => [:environment] do |t, args| | |
foo_id = args[:foo_id].to_i | |
Bar.where(foo_id: foo_id).delete_all | |
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
# frozen_string_literal: true | |
module Hodor | |
class MainService | |
attr_accessor :foo_klass, | |
:foo, | |
:foo_id | |
:foo_status, | |
:bar_service, | |
:baz_service, |
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 Foo | |
class Bar | |
attr_accessor :qux_service, | |
:param1, | |
:param2 | |
#initialize the class and dependencies | |
def initialize(foo_klass = Foo) | |
@foo_klass = foo_klass |
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
# In this file we define the methods to help filter out candidates | |
# This way, we keep these methods separated from other potential parts of the program | |
def experienced?(candidate) | |
amount_of_experience = candidate[:years_of_experience] | |
if amount_of_experience > 2 | |
return true | |
else | |
return false |
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
states = { | |
OR: 'Oregon', | |
FL: 'Florida', | |
CA: 'California', | |
NY: 'New York', | |
MI: 'Michigan' | |
} | |
states[:AR] = "Arkansas" | |
states[:HA] = "Hawaii" |
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
states = { | |
OR: 'Oregon', | |
FL: 'Florida', | |
CA: 'California', | |
NY: 'New York', | |
MI: 'Michigan' | |
} | |
states[:AR] = "Arkansas" | |
states[:HA] = "Hawaii" |