Class: Raptest::Asset
- Inherits:
-
Object
- Object
- Raptest::Asset
- Defined in:
- lib/raptest/asset.rb
Instance Attribute Summary collapse
-
#pathname ⇒ Object
Returns the value of attribute pathname.
Instance Method Summary collapse
- #coffee? ⇒ Boolean
- #css? ⇒ Boolean
- #erb? ⇒ Boolean
-
#initialize(pathname) ⇒ Asset
constructor
A new instance of Asset.
- #js? ⇒ Boolean
- #result ⇒ Object
- #sass? ⇒ Boolean
- #scss? ⇒ Boolean
- #source ⇒ Object
- #test! ⇒ Object
Constructor Details
#initialize(pathname) ⇒ Asset
Returns a new instance of Asset.
12 13 14 |
# File 'lib/raptest/asset.rb', line 12 def initialize(pathname) @pathname = pathname end |
Instance Attribute Details
#pathname ⇒ Object
Returns the value of attribute pathname.
11 12 13 |
# File 'lib/raptest/asset.rb', line 11 def pathname @pathname end |
Instance Method Details
#coffee? ⇒ Boolean
24 25 26 |
# File 'lib/raptest/asset.rb', line 24 def coffee? pathname =~ /\.coffee\b/ end |
#css? ⇒ Boolean
20 21 22 |
# File 'lib/raptest/asset.rb', line 20 def css? pathname =~ /\.css\b/ end |
#erb? ⇒ Boolean
36 37 38 |
# File 'lib/raptest/asset.rb', line 36 def erb? coffee? || pathname =~ /\.erb\b/ end |
#js? ⇒ Boolean
16 17 18 |
# File 'lib/raptest/asset.rb', line 16 def js? pathname =~ /\.js\b/ end |
#result ⇒ Object
44 45 46 |
# File 'lib/raptest/asset.rb', line 44 def result @result end |
#sass? ⇒ Boolean
32 33 34 |
# File 'lib/raptest/asset.rb', line 32 def sass? pathname =~ /\.sass\b/ end |
#scss? ⇒ Boolean
28 29 30 |
# File 'lib/raptest/asset.rb', line 28 def scss? pathname =~ /\.scss\b/ end |
#source ⇒ Object
40 41 42 |
# File 'lib/raptest/asset.rb', line 40 def source @source ||= File.read(pathname) end |