class Soybean::Generators::ModelSpecGenerator
Attributes
name[R]
Public Class Methods
new(model, spec_dir)
click to toggle source
@param model [ModelGenerator]
# File lib/soybean/generators/model_spec_generator.rb, line 9 def initialize(model, spec_dir) @model, @spec_dir = model, spec_dir @name = model.name + '_spec' end
Public Instance Methods
actions()
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 29 def actions @actions ||= InterfaceBuilder.new(@model.wsdl, WSDL::SOAP::ClassNameCreator.new).actions end
class_name()
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 33 def class_name @model.class_name end
dir()
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 18 def dir @spec_dir end
fullpath(basedir)
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 14 def fullpath(basedir) File.join(dir, filename) end
generate()
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 22 def generate source = File.expand_path("../templates/model_spec.rb", __FILE__) context = instance_eval('binding') content = ERB.new(::File.binread(source), nil, '-').result(context) content end
interface_name()
click to toggle source
# File lib/soybean/generators/model_spec_generator.rb, line 37 def interface_name @model.interface_name end