Class: Transpec::Syntax
- Inherits:
-
Object
- Object
- Transpec::Syntax
- Extended by:
- Collection
- Includes:
- DynamicAnalysis, Rewritable
- Defined in:
- lib/transpec/syntax.rb,
lib/transpec/syntax.rb,
lib/transpec/syntax.rb,
lib/transpec/syntax.rb,
lib/transpec/syntax.rb,
lib/transpec/syntax.rb,
lib/transpec/syntax/its.rb,
lib/transpec/syntax/have.rb,
lib/transpec/syntax/hook.rb,
lib/transpec/syntax/allow.rb,
lib/transpec/syntax/double.rb,
lib/transpec/syntax/expect.rb,
lib/transpec/syntax/should.rb,
lib/transpec/syntax/example.rb,
lib/transpec/syntax/pending.rb,
lib/transpec/syntax/receive.rb,
lib/transpec/syntax/be_close.rb,
lib/transpec/syntax/operator.rb,
lib/transpec/syntax/be_boolean.rb,
lib/transpec/syntax/mixin/send.rb,
lib/transpec/syntax/method_stub.rb,
lib/transpec/syntax/raise_error.rb,
lib/transpec/syntax/example_group.rb,
lib/transpec/syntax/mixin/metadata.rb,
lib/transpec/syntax/should_receive.rb,
lib/transpec/syntax/current_example.rb,
lib/transpec/syntax/mixin/examplish.rb,
lib/transpec/syntax/oneliner_should.rb,
lib/transpec/syntax/rspec_configure.rb,
lib/transpec/syntax/have/have_record.rb,
lib/transpec/syntax/mixin/block_owner.rb,
lib/transpec/syntax/mixin/expect_base.rb,
lib/transpec/syntax/mixin/rspec_rails.rb,
lib/transpec/syntax/mixin/should_base.rb,
lib/transpec/syntax/matcher_definition.rb,
lib/transpec/syntax/mixin/expectizable.rb,
lib/transpec/syntax/mixin/monkey_patch.rb,
lib/transpec/syntax/have/source_builder.rb,
lib/transpec/syntax/mixin/matcher_owner.rb,
lib/transpec/syntax/mixin/owned_matcher.rb,
lib/transpec/syntax/mixin/messaging_host.rb,
lib/transpec/syntax/have/dynamic_analysis.rb,
lib/transpec/syntax/rspec_configure/mocks.rb,
lib/transpec/syntax/mixin/context_sensitive.rb,
lib/transpec/syntax/mixin/any_instance_block.rb,
lib/transpec/syntax/mixin/useless_and_return.rb,
lib/transpec/syntax/rspec_configure/framework.rb,
lib/transpec/syntax/mixin/no_message_allowance.rb,
lib/transpec/syntax/rspec_configure/expectations.rb,
lib/transpec/syntax/mixin/monkey_patch_any_instance.rb,
lib/transpec/syntax/rspec_configure/config_modification.rb
Direct Known Subclasses
Allow, BeBoolean, BeClose, CurrentExample, Double, Example, ExampleGroup, Expect, Have, Hook, Its, MatcherDefinition, MethodStub, OnelinerShould, Operator, Pending, RSpecConfigure, RaiseError, Receive, Should, ShouldReceive
Defined Under Namespace
Modules: Collection, Dispatcher, DynamicAnalysis, Mixin, ModuleUtil, Rewritable Classes: Allow, BeBoolean, BeClose, CurrentExample, Double, Example, ExampleGroup, Expect, Have, Hook, Its, MatcherDefinition, MethodStub, OnelinerShould, Operator, Pending, RSpecConfigure, RaiseError, Receive, Should, ShouldReceive
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#runtime_data ⇒ Object
readonly
Returns the value of attribute runtime_data.
-
#source_rewriter ⇒ Object
readonly
Returns the value of attribute source_rewriter.
Class Method Summary collapse
Instance Method Summary collapse
- #conversion_target? ⇒ Boolean
- #dependent_syntaxes ⇒ Object
- #dynamic_analysis_target? ⇒ Boolean
- #expression_range ⇒ Object
-
#initialize(node, source_rewriter = nil, runtime_data = nil, report = nil) ⇒ Syntax
constructor
A new instance of Syntax.
- #inspect ⇒ Object
- #parent_node ⇒ Object
- #static_context_inspector ⇒ Object
Methods included from Collection
all_syntaxes, inherited, mixins, require_all, standalone_syntaxes
Methods included from DynamicAnalysis
#register_dynamic_analysis_request
Constructor Details
#initialize(node, source_rewriter = nil, runtime_data = nil, report = nil) ⇒ Syntax
Returns a new instance of Syntax.
158 159 160 161 162 163 |
# File 'lib/transpec/syntax.rb', line 158 def initialize(node, source_rewriter = nil, runtime_data = nil, report = nil) @node = node @source_rewriter = source_rewriter @runtime_data = runtime_data || DynamicAnalyzer::RuntimeData.new @report = report || Report.new end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
148 149 150 |
# File 'lib/transpec/syntax.rb', line 148 def node @node end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
148 149 150 |
# File 'lib/transpec/syntax.rb', line 148 def report @report end |
#runtime_data ⇒ Object (readonly)
Returns the value of attribute runtime_data.
148 149 150 |
# File 'lib/transpec/syntax.rb', line 148 def runtime_data @runtime_data end |
#source_rewriter ⇒ Object (readonly)
Returns the value of attribute source_rewriter.
148 149 150 |
# File 'lib/transpec/syntax.rb', line 148 def source_rewriter @source_rewriter end |
Class Method Details
.snake_case_name ⇒ Object
154 155 156 |
# File 'lib/transpec/syntax.rb', line 154 def self.snake_case_name @snake_cake_name ||= ModuleUtil.snake_case_name(name) end |
.standalone? ⇒ Boolean
150 151 152 |
# File 'lib/transpec/syntax.rb', line 150 def self.standalone? true end |
Instance Method Details
#conversion_target? ⇒ Boolean
169 170 171 |
# File 'lib/transpec/syntax.rb', line 169 def conversion_target? dynamic_analysis_target? end |
#dependent_syntaxes ⇒ Object
173 174 175 |
# File 'lib/transpec/syntax.rb', line 173 def dependent_syntaxes @dependent_syntaxes ||= [] end |
#dynamic_analysis_target? ⇒ Boolean
165 166 167 |
# File 'lib/transpec/syntax.rb', line 165 def dynamic_analysis_target? false end |
#expression_range ⇒ Object
185 186 187 |
# File 'lib/transpec/syntax.rb', line 185 def expression_range node.loc.expression end |
#inspect ⇒ Object
189 190 191 |
# File 'lib/transpec/syntax.rb', line 189 def inspect "#<#{self.class}: #{node.type}>" end |
#parent_node ⇒ Object
181 182 183 |
# File 'lib/transpec/syntax.rb', line 181 def parent_node node.parent_node end |
#static_context_inspector ⇒ Object
177 178 179 |
# File 'lib/transpec/syntax.rb', line 177 def static_context_inspector @static_context_inspector ||= StaticContextInspector.new(node) end |