Class: Rubylog::DSL::Thats

Inherits:
BasicObject
Defined in:
lib/rubylog/dsl/thats.rb

Direct Known Subclasses

Not

Defined Under Namespace

Classes: Not

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*msg) ⇒ Object



2
3
4
5
6
# File 'lib/rubylog/dsl/thats.rb', line 2

def method_missing *msg
  @messages ||= []
  @messages << msg
  self
end

Instance Method Details

#==(*msg) ⇒ Object



12
13
14
# File 'lib/rubylog/dsl/thats.rb', line 12

def == *msg
  method_missing :==, *msg
end

#inspectObject



18
19
20
# File 'lib/rubylog/dsl/thats.rb', line 18

def inspect
  @messages
end

#rubylog_matches_as_guard?(other) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/rubylog/dsl/thats.rb', line 8

def rubylog_matches_as_guard? other
  @messages.inject(other) {|o,msg|o.send *msg}
end