Module: PryTheme::Theme::DefaultAttrs Private

Included in:
Definition, PryTheme::Theme::Definition::Compound
Defined in:
lib/pry-theme/definition.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.2.0

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

Since:

  • 0.2.0



38
39
40
# File 'lib/pry-theme/definition.rb', line 38

def method_missing(meth, *args, &block)
  raise PryTheme::ThemeError, %|unknown option "#{ meth }"|
end

Instance Method Details

#set_default_attrs(attrs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.2.0



25
26
27
28
29
30
# File 'lib/pry-theme/definition.rb', line 25

def set_default_attrs(attrs)
  default_color = PryTheme.const_get(:"Color#{ @color_model }").new
  attrs.each do |attr|
    instance_variable_set(:"@#{ attr }", default_color.dup)
  end
end

#set_nested_attrsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.2.0



32
33
34
35
36
# File 'lib/pry-theme/definition.rb', line 32

def set_nested_attrs
  regexp { set_default_attrs(Definition::Regexp::ATTRS) }
  shell  { set_default_attrs(Definition::Shell::ATTRS)  }
  string { set_default_attrs(Definition::String::ATTRS) }
end