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.



35
36
37
# File 'lib/u3d_core/globals.rb', line 35

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.



35
36
37
# File 'lib/u3d_core/globals.rb', line 35

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.



35
36
37
# File 'lib/u3d_core/globals.rb', line 35

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.



35
36
37
# File 'lib/u3d_core/globals.rb', line 35

def verbose=(value)
  @verbose = value
end

Class Method Details

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



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

def method_missing(method_sym, *arguments, &block)
  case method_sym.to_s
  when /^with_(.*)$/
    if attributes.include? Regexp.last_match(1)
      with(Regexp.last_match(1).to_sym, arguments.first, &block)
    else
      super
    end
  when /^(.*)\?$/
    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)


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

def respond_to_missing?(method_sym, include_private = false)
  case method_sym.to_s
  when /^with_(.*)$/ || /^(.*)\?$/
    return attributes.include? Regexp.last_match(1)
  else
    super
  end
end