Class: ShopifyCLI::Theme::DevServer::LocalAssets::FileBody
- Inherits:
-
Object
- Object
- ShopifyCLI::Theme::DevServer::LocalAssets::FileBody
- Defined in:
- lib/shopify_cli/theme/dev_server/local_assets.rb
Instance Method Summary collapse
-
#each {|@path.read| ... } ⇒ Object
Naive implementation.
-
#initialize(path) ⇒ FileBody
constructor
A new instance of FileBody.
-
#to_path ⇒ Object
Rack will stream a body that responds to ‘to_path`.
Constructor Details
#initialize(path) ⇒ FileBody
Returns a new instance of FileBody.
10 11 12 |
# File 'lib/shopify_cli/theme/dev_server/local_assets.rb', line 10 def initialize(path) @path = path end |
Instance Method Details
#each {|@path.read| ... } ⇒ Object
Naive implementation. Only used in unit tests.
15 16 17 |
# File 'lib/shopify_cli/theme/dev_server/local_assets.rb', line 15 def each yield @path.read end |
#to_path ⇒ Object
Rack will stream a body that responds to ‘to_path`
20 21 22 |
# File 'lib/shopify_cli/theme/dev_server/local_assets.rb', line 20 def to_path @path.to_path end |