Class: ChargeBee::Event

Inherits:
Model
  • Object
show all
Defined in:
lib/chargebee/models/event.rb

Defined Under Namespace

Classes: Content

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

construct, #initialize, #inspect, #load, #method_missing, #to_s

Constructor Details

This class inherits a constructor from ChargeBee::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ChargeBee::Model

Instance Attribute Details

#event_typeObject

Returns the value of attribute event_type.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def event_type
  @event_type
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def id
  @id
end

#occurred_atObject

Returns the value of attribute occurred_at.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def occurred_at
  @occurred_at
end

#sourceObject

Returns the value of attribute source.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def source
  @source
end

#webhook_failure_reasonObject

Returns the value of attribute webhook_failure_reason.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def webhook_failure_reason
  @webhook_failure_reason
end

#webhook_statusObject

Returns the value of attribute webhook_status.



4
5
6
# File 'lib/chargebee/models/event.rb', line 4

def webhook_status
  @webhook_status
end

Class Method Details

.deserialize(json) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/chargebee/models/event.rb', line 13

def self.deserialize(json)
  begin
    webhook_data = JSON.parse(json)
  rescue JSON::ParserError
    raise APIError.new("Invalid webhook object to deserialize")
  end
  webhook_data = Util.symbolize_keys(webhook_data)
  Event.construct(webhook_data)
end

.list(params = {}, env = nil) ⇒ Object

OPERATIONS




26
27
28
# File 'lib/chargebee/models/event.rb', line 26

def self.list(params={}, env=nil)
  Request.send('get', "/events", params, env)
end

.retrieve(id, env = nil) ⇒ Object



30
31
32
# File 'lib/chargebee/models/event.rb', line 30

def self.retrieve(id, env=nil)
  Request.send('get', "/events/#{id.to_s}", {}, env)
end

Instance Method Details

#contentObject



9
10
11
# File 'lib/chargebee/models/event.rb', line 9

def content
  Content.new(@values[:content])
end