Class: FileTurn::Account

Inherits:
Resource show all
Defined in:
lib/fileturn/resources/account.rb

Class Method Summary collapse

Methods inherited from Resource

conn, #errors

Class Method Details

.created_atObject



28
29
30
# File 'lib/fileturn/resources/account.rb', line 28

def created_at
  @account.created_at
end

.creditsObject



24
25
26
# File 'lib/fileturn/resources/account.rb', line 24

def credits
  @account.credits
end

.idObject



20
21
22
# File 'lib/fileturn/resources/account.rb', line 20

def id
  @account.id
end

.loadObject



7
8
9
10
11
12
13
# File 'lib/fileturn/resources/account.rb', line 7

def load
  conn.get("/users.json", {}, 200) do |params|
    params['created_at'] = DateTime.parse(params['created_at'])
    @account = OpenStruct.new(params)
    self
  end
end

.load_only_if_not_loadedObject



15
16
17
18
# File 'lib/fileturn/resources/account.rb', line 15

def load_only_if_not_loaded
  load if @account.nil? || @account.id.nil?
  self
end

.max_file_size_in_bytesObject



40
41
42
# File 'lib/fileturn/resources/account.rb', line 40

def max_file_size_in_bytes
  @account.max_file_size_in_bytes
end

.notification_urlObject



32
33
34
# File 'lib/fileturn/resources/account.rb', line 32

def notification_url
  @account.notification_url
end

.time_zoneObject



36
37
38
# File 'lib/fileturn/resources/account.rb', line 36

def time_zone
  @account.time_zone
end