Class: Sendly::TenDlcQualifyResult

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/tendlc_resource.rb

Overview

The result of a use-case qualification pre-check. When qualified is false, reason explains why; throughput carries the expected tier when the carrier network reports it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ TenDlcQualifyResult

Returns a new instance of TenDlcQualifyResult.



69
70
71
72
73
74
# File 'lib/sendly/tendlc_resource.rb', line 69

def initialize(data)
  @use_case = data["useCase"] || data["use_case"]
  @qualified = data["qualified"]
  @reason = data["reason"]
  @throughput = data["throughput"] ? TenDlcThroughput.new(data["throughput"]) : nil
end

Instance Attribute Details

#qualifiedObject (readonly)

Returns the value of attribute qualified.



67
68
69
# File 'lib/sendly/tendlc_resource.rb', line 67

def qualified
  @qualified
end

#reasonObject (readonly)

Returns the value of attribute reason.



67
68
69
# File 'lib/sendly/tendlc_resource.rb', line 67

def reason
  @reason
end

#throughputObject (readonly)

Returns the value of attribute throughput.



67
68
69
# File 'lib/sendly/tendlc_resource.rb', line 67

def throughput
  @throughput
end

#use_caseObject (readonly)

Returns the value of attribute use_case.



67
68
69
# File 'lib/sendly/tendlc_resource.rb', line 67

def use_case
  @use_case
end

Instance Method Details

#qualified?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/sendly/tendlc_resource.rb', line 76

def qualified?
  qualified == true
end

#to_hObject



80
81
82
83
84
85
# File 'lib/sendly/tendlc_resource.rb', line 80

def to_h
  {
    use_case: use_case, qualified: qualified, reason: reason,
    throughput: throughput&.to_h
  }.compact
end