Class: Muack::Satisfy
- Inherits:
-
Struct
- Object
- Struct
- Muack::Satisfy
show all
- Defined in:
- lib/muack/satisfy.rb
Defined Under Namespace
Classes: Conj, Disj
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#api_args ⇒ Object
Returns the value of attribute api_args
3
4
5
|
# File 'lib/muack/satisfy.rb', line 3
def api_args
@api_args
end
|
#block ⇒ Object
Returns the value of attribute block
3
4
5
|
# File 'lib/muack/satisfy.rb', line 3
def block
@block
end
|
Instance Method Details
#&(rhs) ⇒ Object
9
|
# File 'lib/muack/satisfy.rb', line 9
def & rhs; Satisfy::Conj.new(self, rhs); end
|
#api_name ⇒ Object
38
39
40
41
|
# File 'lib/muack/satisfy.rb', line 38
def api_name
(self.class.name || 'Unknown')[/(::)*(\w+)$/, 2].
gsub(/([A-Z][a-z]*)+?(?=[A-Z][a-z]*)/, '\\1_').downcase
end
|
#match(actual_arg) ⇒ Object
4
5
6
|
# File 'lib/muack/satisfy.rb', line 4
def match actual_arg
!!block.call(actual_arg)
end
|
#to_s ⇒ Object
Also known as:
inspect
33
34
35
|
# File 'lib/muack/satisfy.rb', line 33
def to_s
"Muack::API.#{api_name}(#{api_args.map(&:inspect).join(', ')})"
end
|
#|(rhs) ⇒ Object
8
|
# File 'lib/muack/satisfy.rb', line 8
def | rhs; Satisfy::Disj.new(self, rhs); end
|