Class: U3dCore::Globals

Inherits:
Object
  • Object
show all
Defined in:
lib/u3d_core/globals.rb

Overview

all these attributes are false by default and can be set overriden temporarily using a

with_attr(value) do
  something
end

construct

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.do_not_login=(value) ⇒ Object (writeonly)

Sets the attribute do_not_login

Parameters:

  • value

    the value to set the attribute do_not_login to.



33
34
35
# File 'lib/u3d_core/globals.rb', line 33

def do_not_login=(value)
  @do_not_login = value
end

.log_timestamps=(value) ⇒ Object (writeonly)

Sets the attribute log_timestamps

Parameters:

  • value

    the value to set the attribute log_timestamps to.



33
34
35
# File 'lib/u3d_core/globals.rb', line 33

def log_timestamps=(value)
  @log_timestamps = value
end

.use_keychain=(value) ⇒ Object (writeonly)

Sets the attribute use_keychain

Parameters:

  • value

    the value to set the attribute use_keychain to.



33
34
35
# File 'lib/u3d_core/globals.rb', line 33

def use_keychain=(value)
  @use_keychain = value
end

.verbose=(value) ⇒ Object (writeonly)

Sets the attribute verbose

Parameters:

  • value

    the value to set the attribute verbose to.



33
34
35
# File 'lib/u3d_core/globals.rb', line 33

def verbose=(value)
  @verbose = value
end

Class Method Details

.method_missing(method_sym, *arguments, &block) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/u3d_core/globals.rb', line 54

def method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ /^with_(.*)$/
    if attributes.include? Regexp.last_match(1)
      with(Regexp.last_match(1).to_sym, arguments.first, &block)
    else
      super
    end
  elsif method_sym.to_s =~ /^(.*)\?$/
    if attributes.include? Regexp.last_match(1)
      is?(Regexp.last_match(1).to_sym)
    else
      super
    end
  else
    super
  end
end

.respond_to_missing?(method_sym, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
76
77
78
79
80
81
82
# File 'lib/u3d_core/globals.rb', line 72

def respond_to_missing?(method_sym, include_private = false)
  # rubocop:disable GuardClause
  if method_sym.to_s =~ /^with_(.*)$/
    return attributes.include? Regexp.last_match(1)
  elsif method_sym.to_s =~ /^(.*)\?$/
    return attributes.include? Regexp.last_match(1)
  else
    super
  end
  # rubocop:enable GuardClause
end