Class: PryTheme::Theme::Definition Private
- Inherits:
-
Object
- Object
- PryTheme::Theme::Definition
- 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.
Defined Under Namespace
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.
[ :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.
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.
Class.new(Compound)
Instance Method Summary collapse
-
#initialize(color_model, &block) ⇒ Definition
constructor
private
A new instance of Definition.
- #regexp(&block) ⇒ Object private
- #shell(&block) ⇒ Object private
- #string(&block) ⇒ Object private
Methods included from DynamicMethod
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.
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.
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.
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.
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 |