Class: Prmd::ReferenceLocalizer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/prmd/core/reference_localizer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Schema references localizer

Direct Known Subclasses

ForArray, ForHash

Defined Under Namespace

Classes: ForArray, ForHash

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ ReferenceLocalizer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ReferenceLocalizer.

Parameters:

  • object (Object)


9
10
11
# File 'lib/prmd/core/reference_localizer.rb', line 9

def initialize(object)
  @object = object
end

Class Method Details

.build(object) ⇒ ReferenceLocalizer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • object (Object)

Returns:



15
16
17
18
19
20
21
22
23
24
# File 'lib/prmd/core/reference_localizer.rb', line 15

def self.build(object)
  case object
  when Array
    ForArray
  when Hash
    ForHash
  else
    self
  end.new(object)
end

.localize(object) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • object (Object)

Returns:

  • (Object)


28
29
30
# File 'lib/prmd/core/reference_localizer.rb', line 28

def self.localize(object)
  build(object).localize
end

Instance Method Details

#localizeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Object)


33
34
35
# File 'lib/prmd/core/reference_localizer.rb', line 33

def localize
  object
end