Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathKit/MPVariable.m
Kim Wittenburg 7438fd1f95 Added Lots of Documentation
Added some nice to haves
Improved and Unified General Code Layout
2015-01-04 02:54:27 +01:00

34 lines
708 B
Objective-C

//
// MPVariable.m
// MathPad
//
// Created by Kim Wittenburg on 09.10.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import "MPVariable.h"
@implementation MPVariable
- (instancetype)initWithVariableName:(NSString *)variableName
{
self = [super init];
if (self) {
NSAssert(variableName != nil, @"variableName must not be nil.");
NSAssert(variableName.length > 0, @"variableName must be at least one character long.");
_variableName = variableName;
}
return self;
}
- (NSDecimalNumber *)doEvaluation:(NSError *__autoreleasing *)error
{
return [self valueForVariable:self.variableName
error:error];
}
@end