Sha256: 2aa01354a01f2132cab60bdc924874045952615e7285d87e7451d7735e4836ca

Contents?: true

Size: 340 Bytes

Versions: 40

Compression:

Stored size: 340 Bytes

Contents

# frozen_string_literal: true

class MyBuilder < Sinclair
  def add_methods
    if options_object.rescue_error
      add_safe_method
    else
      add_method(:symbolize) { @variable.to_sym }
    end
  end

  def add_safe_method
    add_method(:symbolize) do
      @variable.to_sym
    rescue StandardError
      :default
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/support/models/my_builder.rb
sinclair-2.1.0 spec/support/models/my_builder.rb
sinclair-2.0.1 spec/support/models/my_builder.rb
sinclair-2.0.0 spec/support/models/my_builder.rb
sinclair-1.16.3 spec/support/models/my_builder.rb
sinclair-1.16.2 spec/support/models/my_builder.rb
sinclair-1.16.1 spec/support/models/my_builder.rb
sinclair-1.16.0 spec/support/models/my_builder.rb
sinclair-1.15.0 spec/support/models/my_builder.rb
sinclair-1.14.2 spec/support/models/my_builder.rb
sinclair-1.14.1 spec/support/models/my_builder.rb
sinclair-1.14.0 spec/support/models/my_builder.rb
sinclair-1.13.0 spec/support/models/my_builder.rb
sinclair-1.12.1 spec/support/models/my_builder.rb
sinclair-1.12.0 spec/support/models/my_builder.rb
sinclair-1.11.0 spec/support/models/my_builder.rb
sinclair-1.10.0 spec/support/models/my_builder.rb
sinclair-1.9.0 spec/support/models/my_builder.rb
sinclair-1.8.0 spec/support/models/my_builder.rb
sinclair-1.7.0 spec/support/models/my_builder.rb