Class: Sendly::ShortLinkStatus
- Inherits:
-
Object
- Object
- Sendly::ShortLinkStatus
- Defined in:
- lib/sendly/links_resource.rb
Overview
The code and new disabled state returned when a link's kill switch is toggled.
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
Short code that was updated.
-
#disabled ⇒ Boolean
readonly
New disabled state.
Instance Method Summary collapse
-
#disabled? ⇒ Boolean
Whether the link is now disabled.
-
#initialize(data) ⇒ ShortLinkStatus
constructor
A new instance of ShortLinkStatus.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ ShortLinkStatus
Returns a new instance of ShortLinkStatus.
122 123 124 125 |
# File 'lib/sendly/links_resource.rb', line 122 def initialize(data) @code = data["code"] @disabled = data["disabled"] || false end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns Short code that was updated.
117 118 119 |
# File 'lib/sendly/links_resource.rb', line 117 def code @code end |
#disabled ⇒ Boolean (readonly)
Returns New disabled state.
120 121 122 |
# File 'lib/sendly/links_resource.rb', line 120 def disabled @disabled end |
Instance Method Details
#disabled? ⇒ Boolean
Returns Whether the link is now disabled.
128 129 130 |
# File 'lib/sendly/links_resource.rb', line 128 def disabled? disabled end |
#to_h ⇒ Object
132 133 134 |
# File 'lib/sendly/links_resource.rb', line 132 def to_h { code: code, disabled: disabled } end |