Class: Webhookdb::Subscription::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/webhookdb/subscription.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kw) ⇒ Status

Returns a new instance of Status.



127
128
129
# File 'lib/webhookdb/subscription.rb', line 127

def initialize(**kw)
  @data = kw
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



125
126
127
# File 'lib/webhookdb/subscription.rb', line 125

def data
  @data
end

Instance Method Details

#as_json(*_o) ⇒ Object



146
147
148
# File 'lib/webhookdb/subscription.rb', line 146

def as_json(*_o)
  return @data.merge(message: self.message,        display_headers: self.display_headers)
end

#display_headersObject



131
132
133
134
135
136
137
138
139
140
# File 'lib/webhookdb/subscription.rb', line 131

def display_headers
  return [
    [:organization_formatted, "Organization"],
    [:billing_email, "Billing email"],
    [:plan_name, "Plan name"],
    [:integrations_used_formatted, "Integrations used"],
    [:integrations_remaining_formatted, "Integrations left"],
    [:sub_status, "Status"],
  ]
end

#messageObject



142
143
144
# File 'lib/webhookdb/subscription.rb', line 142

def message
  return "Use `webhookdb subscription edit` to set up or modify your subscription."
end