Class: Scim::Kit::V2::Meta

Inherits:
Object
  • Object
show all
Includes:
Templatable
Defined in:
lib/scim/kit/v2/meta.rb

Overview

Represents a meta section

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Templatable

#as_json, #render, #template_name, #to_h, #to_json

Constructor Details

#initialize(resource_type, location) ⇒ Meta

Returns a new instance of Meta.



14
15
16
17
18
19
# File 'lib/scim/kit/v2/meta.rb', line 14

def initialize(resource_type, location)
  @resource_type = resource_type || 'Unknown'
  @location = location
  @created = @last_modified = Time.now
  @version = @created.to_i
end

Instance Attribute Details

#createdObject

Returns the value of attribute created.



10
11
12
# File 'lib/scim/kit/v2/meta.rb', line 10

def created
  @created
end

#last_modifiedObject

Returns the value of attribute last_modified.



10
11
12
# File 'lib/scim/kit/v2/meta.rb', line 10

def last_modified
  @last_modified
end

#locationObject (readonly)

Returns the value of attribute location.



11
12
13
# File 'lib/scim/kit/v2/meta.rb', line 11

def location
  @location
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



12
13
14
# File 'lib/scim/kit/v2/meta.rb', line 12

def resource_type
  @resource_type
end

#versionObject

Returns the value of attribute version.



10
11
12
# File 'lib/scim/kit/v2/meta.rb', line 10

def version
  @version
end

Instance Method Details

#disable_timestampsObject



21
22
23
# File 'lib/scim/kit/v2/meta.rb', line 21

def disable_timestamps
  @version = @created = @last_modified = nil
end