class Aptly::Representation

Base representation class to coerce transactional types into useful objects.

Attributes

connection[RW]

@!attribute connection

@return [Connection] the connection used for instance operations

Public Class Methods

new(connection = nil, hash = {}) click to toggle source

Initialize a new representation @param connection [Connection] connection to use for instance operations @param hash [Hash] native hash to represent

Calls superclass method
# File lib/aptly/representation.rb, line 29
def initialize(connection = nil, hash = {})
  # TODO: https://bugs.ruby-lang.org/issues/13358 prevents us from requiring
  #   a connection.
  # Mocha test mocking uses .allocate to mock quackability
  #   e.g. mock.responds_like_instance_of(Aptly::Repository)
  # So we need allocate to work, which it doesn't because of OpenStruct!
  @connection = connection
  super(hash)
end