Class: Source
- Inherits:
-
Object
- Object
- Source
- Defined in:
- lib/oso/polar/polar.rb
Overview
Polar source string with optional filename.
Instance Attribute Summary collapse
- #filename ⇒ String readonly
- #src ⇒ String readonly
Instance Method Summary collapse
-
#initialize(src, filename: nil) ⇒ Source
constructor
A new instance of Source.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(src, filename: nil) ⇒ Source
Returns a new instance of Source.
37 38 39 40 |
# File 'lib/oso/polar/polar.rb', line 37 def initialize(src, filename: nil) @src = src @filename = filename end |
Instance Attribute Details
#filename ⇒ String (readonly)
33 34 35 |
# File 'lib/oso/polar/polar.rb', line 33 def filename @filename end |
#src ⇒ String (readonly)
33 34 35 |
# File 'lib/oso/polar/polar.rb', line 33 def src @src end |
Instance Method Details
#to_json(*_args) ⇒ Object
42 43 44 |
# File 'lib/oso/polar/polar.rb', line 42 def to_json(*_args) { src: src, filename: filename }.to_json end |