Class: SparkApi::Models::Constraint
- Inherits:
-
Object
- Object
- SparkApi::Models::Constraint
- Defined in:
- lib/spark_api/models/constraint.rb
Constant Summary collapse
- ATTRIBUTES =
["RuleValue","Value","RuleFieldValue","RuleField","RuleName"]
Instance Method Summary collapse
-
#initialize(args) ⇒ Constraint
constructor
A new instance of Constraint.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Constraint
Returns a new instance of Constraint.
6 7 8 |
# File 'lib/spark_api/models/constraint.rb', line 6 def initialize(args) ATTRIBUTES.each { |f| send("#{f}=", args[f]) if args.include?(f) || args.include?(f.to_sym) } end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/spark_api/models/constraint.rb', line 10 def to_s "#{self.RuleName}: Field(#{self.RuleField},#{self.RuleFieldValue}) Value(#{self.RuleValue},#{self.Value})" end |