# Variable

## Attributes

<PyAttributes>

<PyAttribute name="name" value="name">
</PyAttribute>

<PyAttribute name="default" value="default">
</PyAttribute>

</PyAttributes>

## Functions

<PyFunction name="__init__" type="(name, default) -> None" kind="constructor">

<PySourceCode>

```python
def __init__(self, name: str, default: Optional[str]) -> None:
    self.name = name
    self.default = default
```

</PySourceCode>

<div>

<PyParameter name="name" type="str">
</PyParameter>

<PyParameter name="default" type="Optional[str]">
</PyParameter>

</div>

<PyFunctionReturn type="None">
</PyFunctionReturn>

</PyFunction>

<PyFunction name="__repr__" type="() -> str">

<PySourceCode>

```python
def __repr__(self) -> str:
    return f"Variable(name={self.name}, default={self.default})"
```

</PySourceCode>

<PyFunctionReturn type="str">
</PyFunctionReturn>

</PyFunction>

<PyFunction name="__eq__" type="(other) -> bool">

<PySourceCode>

```python
def __eq__(self, other: object) -> bool:
    if not isinstance(other, self.__class__):
        return NotImplemented
    return (self.name, self.default) == (other.name, other.default)
```

</PySourceCode>

<div>

<PyParameter name="other" type="object">
</PyParameter>

</div>

<PyFunctionReturn type="bool">
</PyFunctionReturn>

</PyFunction>

<PyFunction name="__hash__" type="() -> int">

<PySourceCode>

```python
def __hash__(self) -> int:
    return hash((self.__class__, self.name, self.default))
```

</PySourceCode>

<PyFunctionReturn type="int">
</PyFunctionReturn>

</PyFunction>

<PyFunction name="resolve" type="(env) -> str">

<PySourceCode>

```python
def resolve(self, env: Mapping[str, Optional[str]]) -> str:
    default = self.default if self.default is not None else ""
    result = env.get(self.name, default)
    return result if result is not None else ""
```

</PySourceCode>

<div>

<PyParameter name="env" type="Mapping[str, Optional[str]]">
</PyParameter>

</div>

<PyFunctionReturn type="str">
</PyFunctionReturn>

</PyFunction>
