Class: Stormpath::Rails::AccountSerializer
- Inherits:
-
Object
- Object
- Stormpath::Rails::AccountSerializer
- Defined in:
- app/serializers/stormpath/rails/account_serializer.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account) ⇒ AccountSerializer
constructor
A new instance of AccountSerializer.
- #to_h ⇒ Object
Constructor Details
#initialize(account) ⇒ AccountSerializer
Returns a new instance of AccountSerializer.
10 11 12 |
# File 'app/serializers/stormpath/rails/account_serializer.rb', line 10 def initialize(account) @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
4 5 6 |
# File 'app/serializers/stormpath/rails/account_serializer.rb', line 4 def account @account end |
Class Method Details
.to_h(account) ⇒ Object
6 7 8 |
# File 'app/serializers/stormpath/rails/account_serializer.rb', line 6 def self.to_h(account) new(account).to_h end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/serializers/stormpath/rails/account_serializer.rb', line 14 def to_h { account: { href: account.href, username: account.username, modifiedAt: account.modified_at, status: account.status, createdAt: account.created_at, email: account.email, middleName: account.middle_name, surname: account.surname, givenName: account.given_name, fullName: account.full_name } } end |