Class: Lucid::AST::DocString
- Defined in:
- lib/lucid/ast/doc_string.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#file ⇒ Object
Returns the value of attribute file.
Class Method Summary collapse
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#arguments_replaced(arguments) ⇒ Object
:nodoc:.
- #has_text?(text) ⇒ Boolean
-
#initialize(string, content_type) ⇒ DocString
constructor
A new instance of DocString.
-
#to_sexp ⇒ Object
:nodoc:.
- #to_step_definition_arg ⇒ Object
Methods inherited from String
Constructor Details
#initialize(string, content_type) ⇒ DocString
Returns a new instance of DocString.
12 13 14 15 |
# File 'lib/lucid/ast/doc_string.rb', line 12 def initialize(string, content_type) @content_type = content_type super string end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
10 11 12 |
# File 'lib/lucid/ast/doc_string.rb', line 10 def content_type @content_type end |
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/lucid/ast/doc_string.rb', line 4 def file @file end |
Class Method Details
.default_arg_name ⇒ Object
6 7 8 |
# File 'lib/lucid/ast/doc_string.rb', line 6 def self.default_arg_name 'string' end |
Instance Method Details
#accept(visitor) ⇒ Object
21 22 23 |
# File 'lib/lucid/ast/doc_string.rb', line 21 def accept(visitor) visitor.visit_doc_string(self) end |
#arguments_replaced(arguments) ⇒ Object
:nodoc:
25 26 27 28 29 30 31 32 |
# File 'lib/lucid/ast/doc_string.rb', line 25 def arguments_replaced(arguments) #:nodoc: string = self arguments.each do |name, value| value ||= '' string = string.gsub(name, value) end DocString.new(string, content_type) end |
#has_text?(text) ⇒ Boolean
34 35 36 |
# File 'lib/lucid/ast/doc_string.rb', line 34 def has_text?(text) index(text) end |
#to_sexp ⇒ Object
:nodoc:
38 39 40 |
# File 'lib/lucid/ast/doc_string.rb', line 38 def to_sexp #:nodoc: [:doc_string, to_step_definition_arg] end |
#to_step_definition_arg ⇒ Object
17 18 19 |
# File 'lib/lucid/ast/doc_string.rb', line 17 def to_step_definition_arg self end |