Sha256: f6cd60093890fd6eecdc09dac3d5f731765ac3a85591c368ff07a99fc8c80424

Contents?: true

Size: 548 Bytes

Versions: 3

Compression:

Stored size: 548 Bytes

Contents

class RailsStep < Step
  def first_part
    body.gsub(/\s+/,"_").gsub(/'[^']*'/, "__").remove_invalid_chars.sub(/./) do |first_char|
      first_char.downcase
    end
  end
    
  def args_string
    if has_args?
      "(" + args.map {|a| '"' + a.to_s + '"'}.join(", ") + ")"
    else
      ""
    end
  end
  
  def to_s
    message
  end
  
  def parameter_string
    if has_args?
      s = "(arg"
      (args[1..args.length] || []).each_with_index do |a, i|
        s << ", arg#{i+2}"
      end
      s + ")"
    else
      ""
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
features-0.3.0 lib/Rails/rails_step.rb
features-0.2.1 lib/Rails/rails_step.rb
features-0.2.0 lib/Rails/rails_step.rb