Class: TrueTrial::Types::Cancellation

Inherits:
Object
  • Object
show all
Defined in:
lib/truetrial/types/cancellation.rb

Overview

Represents a cancellation returned from the TrueTrial API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Cancellation

Returns a new instance of Cancellation.



10
11
12
13
14
15
16
17
18
# File 'lib/truetrial/types/cancellation.rb', line 10

def initialize(attributes = {})
  @id = attributes["id"]
  @order_id = attributes["order_id"]
  @reason = attributes["reason"]
  @cancelled_by = attributes["cancelled_by"]
  @notes = attributes["notes"]
  @created_at = attributes["created_at"]
  @updated_at = attributes["updated_at"]
end

Instance Attribute Details

#cancelled_byObject (readonly)

Returns the value of attribute cancelled_by.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def cancelled_by
  @cancelled_by
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def id
  @id
end

#notesObject (readonly)

Returns the value of attribute notes.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def notes
  @notes
end

#order_idObject (readonly)

Returns the value of attribute order_id.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def order_id
  @order_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def reason
  @reason
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



7
8
9
# File 'lib/truetrial/types/cancellation.rb', line 7

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Cancellation

Builds a Cancellation from an API response hash.

Parameters:

  • hash (Hash)

    raw API response data

Returns:



24
25
26
# File 'lib/truetrial/types/cancellation.rb', line 24

def self.from_hash(hash)
  new(hash)
end