Module: ODDB::UserObserver

Included in:
Company, Hospital, TestUserObserver::Observer
Defined in:
src/model/user.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) invoice_email



147
148
149
# File 'src/model/user.rb', line 147

def invoice_email
  @invoice_email || contact_email
end

Instance Method Details

- (Object) add_user(user)



131
132
133
134
135
136
137
138
# File 'src/model/user.rb', line 131

def add_user user
  unless user.nil? || users.include?(user)
    users.push user
    users.odba_store
    odba_store
    user
  end
end

- (Object) contact_email



139
140
141
142
143
# File 'src/model/user.rb', line 139

def contact_email
  if usr = users.first
    usr.yus_name
  end
end

- (Boolean) has_user?

Returns:

  • (Boolean)


144
145
146
# File 'src/model/user.rb', line 144

def has_user?
  !users.empty?
end

- (Object) remove_user(user)



150
151
152
153
154
155
156
# File 'src/model/user.rb', line 150

def remove_user user
  if res = users.delete(user)
    users.odba_store
    odba_store
    res
  end
end

- (Object) users



157
158
159
# File 'src/model/user.rb', line 157

def users
  @users ||= [@user].compact
end