Skip to content

Commit

Permalink
rename is_missing? to missing?
Browse files Browse the repository at this point in the history
  • Loading branch information
asaf schers committed Dec 1, 2017
1 parent 1a0c019 commit 324df87
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/scoruby/predicates/compound_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def true?(features)
and?(features) if @boolean_operator == 'and'
end

def is_missing?(features)
def missing?(features)
@field.any? {|f| !features.keys.include?(f)}
end

private

def surrogate?(features)
return @predicates[1].true?(features) if @predicates[0].is_missing?(features)
return @predicates[1].true?(features) if @predicates[0].missing?(features)
@predicates[0].true?(features)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/scoruby/predicates/false_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def true?(_)
false
end

def is_missing?(_)
def missing?(_)
false
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/scoruby/predicates/simple_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def true?(features)
features[field].nil? || !features.has_key?(field) if @operator == IS_MISSING
end

def is_missing?(features)
def missing?(features)
!features.keys.include?(@field)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/scoruby/predicates/simple_set_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def true?(features)
@array.include? features[@field] if @operator == IS_IN
end

def is_missing?(features)
def missing?(features)
!features.keys.include?(@field)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/scoruby/predicates/true_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def true?(_)
true
end

def is_missing?(_)
def missing?(_)
false
end
end
Expand Down

0 comments on commit 324df87

Please sign in to comment.