Class: Pangea::Internal::Util::SerializationAdapter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pangea/internal/util.rb

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inner) ⇒ SerializationAdapter

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 SerializationAdapter.

Parameters:

  • inner (Pathname, IO)


341
# File 'lib/pangea/internal/util.rb', line 341

def initialize(inner) = @inner = inner

Instance Attribute Details

#innerPathname, IO (readonly)

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:

  • (Pathname, IO)


326
327
328
# File 'lib/pangea/internal/util.rb', line 326

def inner
  @inner
end

Instance Method Details

#to_json(*a) ⇒ String

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:

  • a (Object)

Returns:

  • (String)


331
# File 'lib/pangea/internal/util.rb', line 331

def to_json(*a) = (inner.is_a?(IO) ? inner.read : inner.read(binmode: true)).to_json(*a)

#to_yaml(*a) ⇒ String

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:

  • a (Object)

Returns:

  • (String)


336
# File 'lib/pangea/internal/util.rb', line 336

def to_yaml(*a) = (inner.is_a?(IO) ? inner.read : inner.read(binmode: true)).to_yaml(*a)