Class: PryTheme::Theme::Definition Private

Inherits:
Object
  • Object
show all
Extended by:
DynamicMethod
Includes:
DefaultAttrs
Defined in:
lib/pry-theme/definition.rb

Overview

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

@todo: possibly, try to avoid duplication.

Since:

  • 0.2.0

Defined Under Namespace

Classes: Compound, Regexp

Constant Summary collapse

ATTRS =

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

Since:

  • 0.2.0

[
  :class_, :class_variable, :comment, :constant, :error, :float,
  :global_variable, :inline_delimiter, :instance_variable, :integer,
  :keyword, :method, :predefined_constant, :symbol
]
Shell =

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

Since:

  • 0.2.0

Class.new(Compound)
String =

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

Since:

  • 0.2.0

Class.new(Compound)

Instance Method Summary collapse

Methods included from DynamicMethod

def_dynamic_methods

Methods included from DefaultAttrs

#method_missing, #set_default_attrs, #set_nested_attrs

Constructor Details

#initialize(color_model, &block) ⇒ Definition

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.

Returns a new instance of Definition.

Since:

  • 0.2.0



58
59
60
61
62
# File 'lib/pry-theme/definition.rb', line 58

def initialize(color_model, &block)
  @color_model = color_model
  set_default_attrs(ATTRS) and set_nested_attrs
  instance_eval(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PryTheme::Theme::DefaultAttrs

Instance Method Details

#regexp(&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.

Since:

  • 0.2.0



64
65
66
67
# File 'lib/pry-theme/definition.rb', line 64

def regexp(&block)
  @regexp = Definition::Regexp.new(@color_model, &block) if block_given?
  @regexp
end

#shell(&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.

Since:

  • 0.2.0



69
70
71
72
# File 'lib/pry-theme/definition.rb', line 69

def shell(&block)
  @shell = Definition::Shell.new(@color_model, &block) if block_given?
  @shell
end

#string(&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.

Since:

  • 0.2.0



74
75
76
77
# File 'lib/pry-theme/definition.rb', line 74

def string(&block)
  @string = Definition::String.new(@color_model, &block) if block_given?
  @string
end