Class: StructuraidCore::DesignCodes::NSR10::RC::Footings::MinHeight

Inherits:
Object
  • Object
show all
Includes:
Utils::CodeRequirement
Defined in:
lib/structuraid_core/design_codes/nsr_10/rc/footings/min_height.rb

Constant Summary collapse

MIN_HEIGHT_MAPPINGS =
{
  over_soil: 150,
  over_piles: 300
}.freeze
CODE_REFERENCE =
'NSR-10 C.15.7'.freeze

Instance Method Summary collapse

Methods included from Utils::CodeRequirement

included, #initialize

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/structuraid_core/design_codes/nsr_10/rc/footings/min_height.rb', line 17

def call
  support_type = params.support_type || :over_soil
  unless MIN_HEIGHT_MAPPINGS.keys.include?(support_type)
    raise UnrecognizedValueError.new(:support_type, support_type)
  end

  min_height = MIN_HEIGHT_MAPPINGS[support_type]

  return true if bottom_rebar_effective_height >= min_height

  raise RequirementNotFulfilledError.new(
    :min_height,
    "Height #{bottom_rebar_effective_height} is below #{min_height} mininmum",
    CODE_REFERENCE
  )
end