Class: LicenseFinder::PossibleLicenseFile
- Inherits:
-
Object
- Object
- LicenseFinder::PossibleLicenseFile
- Defined in:
- lib/license_finder/packages/possible_license_file.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ PossibleLicenseFile
constructor
A new instance of PossibleLicenseFile.
- #license ⇒ Object
- #path ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(path) ⇒ PossibleLicenseFile
Returns a new instance of PossibleLicenseFile.
3 4 5 |
# File 'lib/license_finder/packages/possible_license_file.rb', line 3 def initialize(path) @path = Pathname(path) end |
Instance Method Details
#license ⇒ Object
11 12 13 |
# File 'lib/license_finder/packages/possible_license_file.rb', line 11 def license License.find_by_text(text) end |
#path ⇒ Object
7 8 9 |
# File 'lib/license_finder/packages/possible_license_file.rb', line 7 def path @path.to_s end |
#text ⇒ Object
15 16 17 |
# File 'lib/license_finder/packages/possible_license_file.rb', line 15 def text @text ||= (@path.respond_to?(:binread) ? @path.binread : @path.read) end |