Method: AEMO::NMI::Allocation#initialize

Defined in:
lib/aemo/nmi/allocation.rb

#initialize(title, type, opts = {}) ⇒ AEMO::NMI::Allocation

Initialises an AEMO::NMI::Allocation

Parameters:

  • title (String)
  • type (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :identifier (String)
  • :friendly_title (String)
  • :exclude_nmi_patterns (Array<Regexp>)
  • :include_nmi_patterns (Array<Regexp>)
  • :region (String)

Since:

  • 0.3.0


440
441
442
443
444
445
446
447
448
# File 'lib/aemo/nmi/allocation.rb', line 440

def initialize(title, type, opts = {})
  @title = title
  @type = parse_allocation_type(type)
  @identifier = opts.fetch(:participant_id, title.upcase)
  @friendly_title = opts.fetch(:friendly_title, title)
  @exclude_nmi_patterns = opts.fetch(:excludes, [])
  @include_nmi_patterns = opts.fetch(:includes, [])
  @region = AEMO::Region.new(opts.fetch(:region)) if opts[:region]
end