Class: SimpleAMS::Document::PrimaryId

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_ams/document/primary_id.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PrimaryId

Returns a new instance of PrimaryId.



4
5
6
7
# File 'lib/simple_ams/document/primary_id.rb', line 4

def initialize(options)
  @options = options
  @name = options.primary_id.name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/simple_ams/document/primary_id.rb', line 2

def name
  @name
end

Instance Method Details

#optionsObject



17
18
19
# File 'lib/simple_ams/document/primary_id.rb', line 17

def options
  @options.primary_id.options
end

#valueObject



9
10
11
12
13
14
15
# File 'lib/simple_ams/document/primary_id.rb', line 9

def value
  if @options.serializer.respond_to?(name)
    @options.serializer.send(name)
  else
    @options.resource.send(name)
  end
end