Class: WebResourceBundler::ResourceFile

Inherits:
Object
  • Object
show all
Defined in:
lib/web_resource_bundler/content_management/resource_file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#contentObject

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

#pathObject

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

#typeObject

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

#cloneObject



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