Class: Ast::Crispr::StructureProfile
- Inherits:
-
Object
- Object
- Ast::Crispr::StructureProfile
- Includes:
- ProfileReportCompatibility
- Defined in:
- lib/ast/crispr.rb,
lib/ast/crispr.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#owner_scope ⇒ Object
readonly
Returns the value of attribute owner_scope.
-
#owner_selector ⇒ Object
readonly
Returns the value of attribute owner_selector.
-
#supported_comment_regions ⇒ Object
readonly
Returns the value of attribute supported_comment_regions.
Instance Method Summary collapse
-
#initialize(owner_scope:, owner_selector:, supported_comment_regions: [], metadata: {}, **options) ⇒ StructureProfile
constructor
A new instance of StructureProfile.
- #known_owner_selector? ⇒ Boolean
- #owner_selector_family ⇒ Object
- #owner_selector_metadata ⇒ Object
- #report ⇒ Object
- #supports_comment_region?(region) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(owner_scope:, owner_selector:, supported_comment_regions: [], metadata: {}, **options) ⇒ StructureProfile
Returns a new instance of StructureProfile.
457 458 459 460 461 462 |
# File 'lib/ast/crispr.rb', line 457 def initialize(owner_scope:, owner_selector:, supported_comment_regions: [], metadata: {}, **) @owner_scope = owner_scope&.to_sym @owner_selector = owner_selector&.to_sym @supported_comment_regions = Array(supported_comment_regions).map(&:to_sym).freeze @metadata = .merge().freeze end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
455 456 457 |
# File 'lib/ast/crispr.rb', line 455 def @metadata end |
#owner_scope ⇒ Object (readonly)
Returns the value of attribute owner_scope.
455 456 457 |
# File 'lib/ast/crispr.rb', line 455 def owner_scope @owner_scope end |
#owner_selector ⇒ Object (readonly)
Returns the value of attribute owner_selector.
455 456 457 |
# File 'lib/ast/crispr.rb', line 455 def owner_selector @owner_selector end |
#supported_comment_regions ⇒ Object (readonly)
Returns the value of attribute supported_comment_regions.
455 456 457 |
# File 'lib/ast/crispr.rb', line 455 def supported_comment_regions @supported_comment_regions end |
Instance Method Details
#known_owner_selector? ⇒ Boolean
472 473 474 |
# File 'lib/ast/crispr.rb', line 472 def known_owner_selector? Ast::Merge::Ruleset::ProfileVocabulary.known_owner_selector?(owner_selector) end |
#owner_selector_family ⇒ Object
468 469 470 |
# File 'lib/ast/crispr.rb', line 468 def owner_selector_family &.fetch(:family, nil) end |
#owner_selector_metadata ⇒ Object
464 465 466 |
# File 'lib/ast/crispr.rb', line 464 def Ast::Merge::Ruleset::ProfileVocabulary.(owner_selector) end |
#report ⇒ Object
1680 1681 1682 |
# File 'lib/ast/crispr.rb', line 1680 def report stringified_report(to_h) end |
#supports_comment_region?(region) ⇒ Boolean
476 477 478 |
# File 'lib/ast/crispr.rb', line 476 def supports_comment_region?(region) supported_comment_regions.include?(region.to_sym) end |
#to_h ⇒ Object
480 481 482 483 484 485 486 487 488 489 |
# File 'lib/ast/crispr.rb', line 480 def to_h { owner_scope: owner_scope, owner_selector: owner_selector, owner_selector_family: owner_selector_family, known_owner_selector: known_owner_selector?, supported_comment_regions: supported_comment_regions, metadata: } end |