Class: Sendly::TenDlcQualifyResult
- Inherits:
-
Object
- Object
- Sendly::TenDlcQualifyResult
- 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
-
#qualified ⇒ Object
readonly
Returns the value of attribute qualified.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#throughput ⇒ Object
readonly
Returns the value of attribute throughput.
-
#use_case ⇒ Object
readonly
Returns the value of attribute use_case.
Instance Method Summary collapse
-
#initialize(data) ⇒ TenDlcQualifyResult
constructor
A new instance of TenDlcQualifyResult.
- #qualified? ⇒ Boolean
- #to_h ⇒ Object
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
#qualified ⇒ Object (readonly)
Returns the value of attribute qualified.
67 68 69 |
# File 'lib/sendly/tendlc_resource.rb', line 67 def qualified @qualified end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
67 68 69 |
# File 'lib/sendly/tendlc_resource.rb', line 67 def reason @reason end |
#throughput ⇒ Object (readonly)
Returns the value of attribute throughput.
67 68 69 |
# File 'lib/sendly/tendlc_resource.rb', line 67 def throughput @throughput end |
#use_case ⇒ Object (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
76 77 78 |
# File 'lib/sendly/tendlc_resource.rb', line 76 def qualified? qualified == true end |
#to_h ⇒ Object
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 |