Class: DhanHQ::Risk::Checks::AsmGsm

Inherits:
Object
  • Object
show all
Defined in:
lib/DhanHQ/risk/checks/asm_gsm.rb

Overview

Blocks trading on ASM/GSM restricted instruments.

Class Method Summary collapse

Class Method Details

.run!(instrument:, **_unused) ⇒ Object



8
9
10
11
12
13
# File 'lib/DhanHQ/risk/checks/asm_gsm.rb', line 8

def self.run!(instrument:, **_unused)
  return unless instrument.asm_gsm_flag == "Y"

  raise DhanHQ::RiskViolation,
        "ASM/GSM restricted instrument (#{instrument.asm_gsm_category})"
end