"""Create logic_validator
Generated by Phi-Octopus Eden
2025-11-07 03:43:25.628193
"""

```python
from typing import Any, Callable, Dict


def logic_validator(
    input_data: Any,
    validation_rules: Dict[str, Callable[[Any], bool]],
) -> bool:
    """
    Validate data based on predefined rules.

    Args:
        input_data (Any): The data to be validated.
        validation_rules (Dict[str, Callable[[Any], bool]]):
            A dictionary of field names as keys and validation functions
            as values. Each validation function takes a single argument,
            the value to validate, and returns True if it passes or False otherwise.

    Returns:
        bool: True if all validations pass, False otherwise.
    """
    for field, rule in validation_rules.items():
        # Extracting the relevant part of input_data based on the field name
        value = getattr(input_data, field, None)
        if value is None and not rule.__name__ == 'optional':
            continue
        if not rule(value):
            return False
    return True


class DataObject:
    def __init__(self, data: Dict[str, Any]):
        self.data = data

    @property
    def field1(self) -> int:
        return self.data.get('field1')

    @property
    def field2(self) -> str:
        return self.data.get('field2')


# Example usage
def is_positive(number: int) -> bool:
    """Check if a number is positive."""
    return number > 0


def is_not_empty(text: str) -> bool:
    """Check if a text is not empty."""
    return len(text.strip()) > 0


validation_rules = {
    'field1': is_positive,
    'field2': is_not_empty,
}

data_example = {'field1': 5, 'field2': 'example'}

validator = DataObject(data_example)
result = logic_validator(validator, validation_rules)

print(f"All validations passed: {result}")
```