Class: Referral::Value::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/referral/value/options.rb

Constant Summary collapse

DEFAULT =
new(
  columns: ["location", "type", "scope", "name"],
  delimiter: " ",
  include_unnamed: false,
  sort: "file",
  print_headers: false,
).freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#arityObject

Returns the value of attribute arity

Returns:

  • (Object)

    the current value of arity



3
4
5
# File 'lib/referral/value/options.rb', line 3

def arity
  @arity
end

#columnsObject

Returns the value of attribute columns

Returns:

  • (Object)

    the current value of columns



3
4
5
# File 'lib/referral/value/options.rb', line 3

def columns
  @columns
end

#delimiterObject

Returns the value of attribute delimiter

Returns:

  • (Object)

    the current value of delimiter



3
4
5
# File 'lib/referral/value/options.rb', line 3

def delimiter
  @delimiter
end

#exact_nameObject

Returns the value of attribute exact_name

Returns:

  • (Object)

    the current value of exact_name



3
4
5
# File 'lib/referral/value/options.rb', line 3

def exact_name
  @exact_name
end

#filesObject

Returns the value of attribute files

Returns:

  • (Object)

    the current value of files



3
4
5
# File 'lib/referral/value/options.rb', line 3

def files
  @files
end

#full_nameObject

Returns the value of attribute full_name

Returns:

  • (Object)

    the current value of full_name



3
4
5
# File 'lib/referral/value/options.rb', line 3

def full_name
  @full_name
end

#include_unnamedObject

Returns the value of attribute include_unnamed

Returns:

  • (Object)

    the current value of include_unnamed



3
4
5
# File 'lib/referral/value/options.rb', line 3

def include_unnamed
  @include_unnamed
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/referral/value/options.rb', line 3

def name
  @name
end

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



3
4
5
# File 'lib/referral/value/options.rb', line 3

def pattern
  @pattern
end

Returns the value of attribute print_headers

Returns:

  • (Object)

    the current value of print_headers



3
4
5
# File 'lib/referral/value/options.rb', line 3

def print_headers
  @print_headers
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



3
4
5
# File 'lib/referral/value/options.rb', line 3

def scope
  @scope
end

#sortObject

Returns the value of attribute sort

Returns:

  • (Object)

    the current value of sort



3
4
5
# File 'lib/referral/value/options.rb', line 3

def sort
  @sort
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/referral/value/options.rb', line 3

def type
  @type
end

Class Method Details

.default(overrides = {}) ⇒ Object



23
24
25
# File 'lib/referral/value/options.rb', line 23

def self.default(overrides = {})
  DEFAULT.merge({files: Dir["**/*.rb"]}.merge(overrides))
end

Instance Method Details

#merge(new_opts) ⇒ Object



35
36
37
# File 'lib/referral/value/options.rb', line 35

def merge(new_opts)
  self.class.new(to_h.merge(new_opts))
end