diff options
| author | mokha <mokha@cisco.com> | 2019-01-16 09:48:53 -0700 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-01-16 09:48:53 -0700 |
| commit | a6b3cc646b2d94c9f1430ed9b43647fc0f205b59 (patch) | |
| tree | c6e036cd97465019198d6d911d1dee81947b4297 /lib | |
| parent | 6e25b328ea18e4aef9703501c264be27b6c712d2 (diff) | |
allow initializing resource with attributesv0.2.13
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/scim/kit/v2/resource.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/scim/kit/v2/resource.rb b/lib/scim/kit/v2/resource.rb index 6286adb..7a63b65 100644 --- a/lib/scim/kit/v2/resource.rb +++ b/lib/scim/kit/v2/resource.rb @@ -15,13 +15,14 @@ module Scim validate :schema_validations - def initialize(schemas:, location: nil) + def initialize(schemas:, location: nil, attributes: {}) @meta = Meta.new(schemas[0].name, location) @meta.disable_timestamps @schemas = schemas schemas.each do |schema| define_attributes_for(self, schema.attributes) end + assign_attributes(attributes) yield self if block_given? end |
