Class: WebResourceBundler::ResourceFile
- Inherits:
-
Object
- Object
- WebResourceBundler::ResourceFile
- Defined in:
- lib/web_resource_bundler/content_management/resource_file.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#path ⇒ Object
Returns the value of attribute path.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
- .new_css_file(path, content = "") ⇒ Object
- .new_js_file(path, content = "") ⇒ Object
- .new_mhtml_css_file(path, content = "") ⇒ Object
- .new_mhtml_file(path, content = "") ⇒ Object
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(path, content, type) ⇒ ResourceFile
constructor
A new instance of ResourceFile.
Constructor Details
#initialize(path, content, type) ⇒ ResourceFile
Returns a new instance of ResourceFile.
19 20 21 22 23 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 19 def initialize(path, content, type) @type = type @content = content @path = path end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
17 18 19 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 17 def content @content end |
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 17 def path @path end |
#type ⇒ Object
Returns the value of attribute type.
17 18 19 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 17 def type @type end |
Class Method Details
.new_css_file(path, content = "") ⇒ Object
31 32 33 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 31 def new_css_file(path, content = "") ResourceFile.new(path, content, ResourceFileType::CSS) end |
.new_js_file(path, content = "") ⇒ Object
27 28 29 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 27 def new_js_file(path, content = "") ResourceFile.new(path, content, ResourceFileType::JS) end |
.new_mhtml_css_file(path, content = "") ⇒ Object
35 36 37 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 35 def new_mhtml_css_file(path, content = "") ResourceFile.new(path, content, ResourceFileType::MHTML_CSS) end |
.new_mhtml_file(path, content = "") ⇒ Object
39 40 41 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 39 def new_mhtml_file(path, content = "") ResourceFile.new(path, content, ResourceFileType::MHTML) end |
Instance Method Details
#clone ⇒ Object
45 46 47 |
# File 'lib/web_resource_bundler/content_management/resource_file.rb', line 45 def clone ResourceFile.new(self.path.dup, self.content.dup, self.type.dup) end |