Sha256: f01e479d498cb6d6e8e7e06cddab966fdb1b08051b9f2e857fc060770da8f12f

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

module ScaffoldParser
  module Scaffolders
    class XSD
      class Parser
        module Handlers
          module BaseMethod
            attr_accessor :source

            def initialize(source)
              @source = source
            end

            def method_name
              source.name.underscore
            end

            def to_s
              f = StringIO.new

              f.puts "def #{method_name}"
              f.puts indent(method_body.lines).join
              f.puts "end"

              f.string.strip
            end

            def ==(other)
              method_name == other.method_name &&
                method_body == other.method_body
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scaffold_parser-0.6.0 lib/scaffold_parser/scaffolders/xsd/parser/handlers/base_method.rb