Class: CodeInclusion::Listing
- Inherits:
-
Object
- Object
- CodeInclusion::Listing
- Defined in:
- lib/polytexnic/code_inclusion.rb
Overview
It contains factory methods to choose the correct FullListing and Subset classes and the code to wire them together. If you add new FullListing or Subset objects, you’ll need to wire them together here.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Class Method Summary collapse
-
.for(args) ⇒ Object
Returns the lines of code to be included or an exception containing the error message.
Instance Method Summary collapse
- #final_listing ⇒ Object
-
#initialize(args) ⇒ Listing
constructor
A new instance of Listing.
Constructor Details
#initialize(args) ⇒ Listing
Returns a new instance of Listing.
226 227 228 |
# File 'lib/polytexnic/code_inclusion.rb', line 226 def initialize(args) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
224 225 226 |
# File 'lib/polytexnic/code_inclusion.rb', line 224 def args @args end |
Class Method Details
.for(args) ⇒ Object
Returns the lines of code to be included or
an exception containing the error message.
220 221 222 |
# File 'lib/polytexnic/code_inclusion.rb', line 220 def self.for(args) new(args).final_listing end |
Instance Method Details
#final_listing ⇒ Object
230 231 232 233 234 235 236 |
# File 'lib/polytexnic/code_inclusion.rb', line 230 def final_listing subset_class.new(full_listing, args).lines rescue SubsetException => e raise RetrievalException.new(e. + " in file '#{args[:filename]}'") end |