Class: IdnSdkRuby::Com::Nbos::Capi::Modules::Identity::V0::UpdatePasswordApiModel

Inherits:
BasicActiveModel
  • Object
show all
Defined in:
lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(password = nil, new_password = nil) ⇒ UpdatePasswordApiModel

Returns a new instance of UpdatePasswordApiModel.



10
11
12
13
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 10

def initialize(password = nil, new_password = nil)
  @password = password
  @newPassword = new_password
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



9
10
11
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 9

def message
  @message
end

#newPasswordObject

Returns the value of attribute newPassword.



9
10
11
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 9

def newPassword
  @newPassword
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 9

def password
  @password
end

Instance Method Details

#add_errors(json_response) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 15

def add_errors(json_response)
  json_response["errors"].each do |e|
    property_name = e['propertyName']
    msg = e['message']
    self.errors[property_name] << msg
  end
end

#add_messages(json_response) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 23

def add_messages(json_response)
  if json_response["message"].present?
    @message = json_response["message"]
  elsif json_response["error"].present?
    @message = json_response["error"]
  end

end

#as_json(options = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 32

def as_json(options={})
  {
      password: @password,
      newPassword: @newPassword,
      message: @message
  }
end

#to_json(*options) ⇒ Object



40
41
42
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 40

def to_json(*options)
  as_json(*options).to_json(*options)
end

#to_sObject



44
45
46
# File 'lib/idn_sdk_ruby/com/nbos/capi/modules/identity/v0/update_password_api_model.rb', line 44

def to_s
  to_json
end