Class: Bio::BaseSpace::Purchase

Inherits:
Model
  • Object
show all
Defined in:
lib/basespace/model/purchase.rb

Overview

Represents a BaseSpace Purchase object.

Instance Attribute Summary

Attributes inherited from Model

#attributes, #swagger_types

Instance Method Summary collapse

Methods inherited from Model

#get_attr, #method_missing, #set_attr, #to_str

Constructor Details

#initializePurchase

Create a new Purchase instance.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/basespace/model/purchase.rb', line 24

def initialize
  @swagger_types = {
    'Id'                   => 'str',
    'Status'               => 'str',       # PENDING, CANCELLED, ERRORED, COMPLETED
    'RefundStatus'         => 'str',       # NOTREFUNDED, REFUNDED
    'DateCreated'          => 'datetime',
    'DateUpdated'          => 'datetime',
    'InvoiceNumber'        => 'str',
    'Amount'               => 'str',
    'AmountOfTax'          => 'str',
    'AmountTotal'          => 'str',
    'Products'             => 'list<Product>',
    'PurchaseType'         => 'str',
    'AppSession'           => 'AppSessionCompact',
    'User'                 => 'UserCompact',
    'Application'          => 'ApplicationCompact',
    'HrefPurchaseDialog'   => 'str',       # new purchases only
    'RefundSecret'         => 'str',       # new purchases only
    'ExceptionMessage'     => 'str',       # errors only
    'ExceptionStackTrace'  => 'str',       # errors only
    'DateRefunded'         => 'datetime',  # refunds only
    'UserRefundedBy'       => 'str',       # refunds only
    'RefundComment'        => 'str',       # refunds only
  }
  @attributes = {
    'Id'                   => nil,
    'Status'               => nil,
    'RefundStatus'         => nil,
    'DateCreated'          => nil,
    'DateUpdated'          => nil,
    'InvoiceNumber'        => nil,
    'Amount'               => nil,
    'AmountOfTax'          => nil,
    'AmountTotal'          => nil,
    'Products'             => nil,
    'PurchaseType'         => nil,
    'AppSession'           => nil,
    'User'                 => nil,
    'Application'          => nil,
    'HrefPurchaseDialog'   => nil,
    'RefundSecret'         => nil,
    'ExceptionMessage'     => nil,
    'ExceptionStackTrace'  => nil,
    'DateRefunded'         => nil,
    'UserRefundedBy'       => nil,
    'RefundComment'        => nil,
  }
end

Dynamic Method Handling

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

Instance Method Details

#is_initObject

Test if the Purchase instance has been initialized.

Throws ModelNotInitializedError, if the object has not been populated yet.



81
82
83
# File 'lib/basespace/model/purchase.rb', line 81

def is_init
  raise ModelNotInitializedError.new('The project model has not been initialized yet') unless get_attr('Id')
end

#to_sObject

Return the purchase ID.



74
75
76
# File 'lib/basespace/model/purchase.rb', line 74

def to_s
  return @id.to_s
end