Class: Lutaml::UmlRepository::Presenters::ElementPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/uml_repository/presenters/element_presenter.rb

Overview

Abstract base class for presenting UML elements.

Defines the common interface that all element presenters must implement. Provides shared utility methods for formatting.

Subclasses must implement: to_text, to_table_row, to_hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element, repository = nil, context = nil) ⇒ ElementPresenter

Returns a new instance of ElementPresenter.

Parameters:

  • element (Object)

    The UML element to present

  • repository (UmlRepository, nil) (defaults to: nil)

    Optional repository for additional context

  • context (Hash, nil) (defaults to: nil)

    Optional context hash



19
20
21
22
23
# File 'lib/lutaml/uml_repository/presenters/element_presenter.rb', line 19

def initialize(element, repository = nil, context = nil)
  @element = element
  @repository = repository
  @context = context || {}
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



13
14
15
# File 'lib/lutaml/uml_repository/presenters/element_presenter.rb', line 13

def context
  @context
end

#elementObject (readonly)

Returns the value of attribute element.



13
14
15
# File 'lib/lutaml/uml_repository/presenters/element_presenter.rb', line 13

def element
  @element
end

#repositoryObject (readonly)

Returns the value of attribute repository.



13
14
15
# File 'lib/lutaml/uml_repository/presenters/element_presenter.rb', line 13

def repository
  @repository
end