Class: Bogus::MethodStringifier

Inherits:
Object
  • Object
show all
Defined in:
lib/bogus/fakes/method_stringifier.rb

Instance Method Summary collapse

Instance Method Details

#argument_values(arguments) ⇒ Object



16
17
18
# File 'lib/bogus/fakes/method_stringifier.rb', line 16

def argument_values(arguments)
  stringify_arguments(arguments)
end

#arguments_as_string(arguments) ⇒ Object



12
13
14
# File 'lib/bogus/fakes/method_stringifier.rb', line 12

def arguments_as_string(arguments)
  stringify_arguments(arguments, DefaultValue)
end

#stringify(method, body) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/bogus/fakes/method_stringifier.rb', line 4

def stringify(method, body)
  <<-RUBY
  def #{method.name}(#{arguments_as_string(method.parameters)})
    #{body}
  end
  RUBY
end