Sha256: 122ab58e7b0bc4c35d596a010c6b66b19b1a0922e17f5c268ad54017b9d6b6b9

Contents?: true

Size: 1.29 KB

Versions: 31

Compression:

Stored size: 1.29 KB

Contents

# In-memory implementation of {Metasploit::Model::Module::Path} to allow testing of {Metasploit::Model::Module::Path} in
# an ActiveModel and use of factories.
class Dummy::Module::Path < Metasploit::Model::Base
  include Metasploit::Model::Module::Path

  #
  # Attributes Methods - used to track changed attributes
  #

  define_attribute_method :gem
  define_attribute_method :name

  #
  # Attributes
  #

  # @!attribute [rw] gem
  #   The gem that owns this path.
  #
  #   @return [String, nil]
  attr_accessor :gem

  # @!attribute [rw] name
  #   The name of this path, scoped to {#gem}.
  #
  #   @return [String, nil]
  attr_accessor :name

  # @!attribute [rw] real_path
  #   Real (absolute) path on-disk.
  #
  #   @return [String]
  attr_accessor :real_path

  #
  # Methods
  #

  # Updates {#gem} value and marks {#gem} as changed if `gem` differs from
  # {#gem}.
  #
  # @param gem [String, nil] (see #gem)
  # @return [String, nil] `gem`
  def gem=(gem)
    unless gem == @gem
      gem_will_change!
    end

    @gem = gem
  end

  # Updates {#name} value and marks {#name} as changed if `name` differs
  # from {#name}.
  #
  # @param name [String, nil] (see #name)
  # @return [String, nil] `name`
  def name=(name)
    unless name == @name
      name_will_change!
    end

    @name = name
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.25.3 spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.3-java spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.2 spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.2-java spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.1 spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.1-java spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.24.1-java spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.24.1 spec/dummy/app/models/dummy/module/path.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 spec/dummy/app/models/dummy/module/path.rb