class OverSIP::Modules::Callsign::Identity

Attributes

identifier[RW]
type[RW]

Public Class Methods

new(identifier, type) click to toggle source
# File lib/oversip-mod-callsign/identity.rb, line 8
def initialize(identifier, type)
  @identifier = identifier
  @type = type
end
parse(input) click to toggle source
# File lib/oversip-mod-callsign/identity.rb, line 13
def self.parse(input)
  result, identifier, type = /^(.*):(\w+)$/.match(input).to_a.flatten
  raise("Unable to parse identity: #{input}") if result.nil?
  Identity.new identifier, type
end