Class: Alula::DealerAccountTransfer

Inherits:
RestResource show all
Extended by:
ApiOperations::List, ApiOperations::Request, ResourceAttributes
Defined in:
lib/alula/resources/dealer_account_transfer.rb

Instance Attribute Summary

Attributes inherited from ApiResource

#dirty_attributes, #errors, #id, #link_matchers, #links, #rate_limit, #raw_data, #values

Instance Method Summary collapse

Methods included from ResourceAttributes

date_fields, extended, field, field_names, filterable_fields, get_fields, get_http_methods, get_resource_path, get_type, http_methods, param_key, read_only_attributes, resource_path, sortable_fields, type

Methods included from ApiOperations::Request

build_and_merge_item_relationships, extended, retrieve

Methods included from ApiOperations::List

build_and_merge_list_relationships, extended, list, method_missing

Methods inherited from RestResource

resource_url, #resource_url

Methods inherited from ApiResource

#annotate_errors, #apply_attributes, #as_json, #as_patchable_json, build, #cache_links, class_name, #clone, #construct_from, #dirty?, #errors?, #filter_builder, #initialize, #model_name, #reconstruct_from, #refresh

Constructor Details

This class inherits a constructor from Alula::ApiResource

Instance Method Details

#admin_actionable?Boolean

Returns:

  • (Boolean)


165
166
167
168
169
170
# File 'lib/alula/resources/dealer_account_transfer.rb', line 165

def admin_actionable?
   self.date_completed.nil? &&
  !self.authorized &&
  !self.denied &&
  !self.cancelled
end

#stateObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/alula/resources/dealer_account_transfer.rb', line 149

def state
  if !self.date_completed.nil?
    :completed
  elsif self.cancelled
    :cancelled
  elsif self.rejected
    :rejected
  elsif self.denied
    :denied
  elsif self.authorized
    :authorized
  else
    :requested
  end
end