Class: Sendly::ShortLinkStatus

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#codeString (readonly)

Returns Short code that was updated.

Returns:

  • (String)

    Short code that was updated



117
118
119
# File 'lib/sendly/links_resource.rb', line 117

def code
  @code
end

#disabledBoolean (readonly)

Returns New disabled state.

Returns:

  • (Boolean)

    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.

Returns:

  • (Boolean)

    Whether the link is now disabled



128
129
130
# File 'lib/sendly/links_resource.rb', line 128

def disabled?
  disabled
end

#to_hObject



132
133
134
# File 'lib/sendly/links_resource.rb', line 132

def to_h
  { code: code, disabled: disabled }
end