Class: VisualStudioFiles::FileReference
- Inherits:
-
Object
- Object
- VisualStudioFiles::FileReference
- Defined in:
- lib/visual_studio_files.rb
Instance Attribute Summary collapse
-
#copy_to_output_directory ⇒ Object
readonly
Returns the value of attribute copy_to_output_directory.
-
#dependent_upon ⇒ Object
readonly
Returns the value of attribute dependent_upon.
-
#downcase_and_path_replaced ⇒ Object
readonly
Returns the value of attribute downcase_and_path_replaced.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#sub_type ⇒ Object
readonly
Returns the value of attribute sub_type.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #[]=(idx, value) ⇒ Object
- #compile? ⇒ Boolean
- #content? ⇒ Boolean
- #embedded_resource? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(opts) ⇒ FileReference
constructor
A new instance of FileReference.
- #link? ⇒ Boolean
- #none? ⇒ Boolean
- #page? ⇒ Boolean
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(opts) ⇒ FileReference
Returns a new instance of FileReference.
87 88 89 90 91 |
# File 'lib/visual_studio_files.rb', line 87 def initialize opts opts.each do |key,value| self[key]=value end end |
Instance Attribute Details
#copy_to_output_directory ⇒ Object (readonly)
Returns the value of attribute copy_to_output_directory.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def copy_to_output_directory @copy_to_output_directory end |
#dependent_upon ⇒ Object (readonly)
Returns the value of attribute dependent_upon.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def dependent_upon @dependent_upon end |
#downcase_and_path_replaced ⇒ Object (readonly)
Returns the value of attribute downcase_and_path_replaced.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def downcase_and_path_replaced @downcase_and_path_replaced end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def file @file end |
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def generator @generator end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def link @link end |
#sub_type ⇒ Object (readonly)
Returns the value of attribute sub_type.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def sub_type @sub_type end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
86 87 88 |
# File 'lib/visual_studio_files.rb', line 86 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
95 96 97 |
# File 'lib/visual_studio_files.rb', line 95 def ==(other) other.downcase_and_path_replaced == @downcase_and_path_replaced end |
#[]=(idx, value) ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/visual_studio_files.rb', line 98 def []=(idx,value) case idx when :file @file = value when :type @type = value when :link @link = value when :dependent_upon @dependent_upon = value when :sub_type @sub_type = value when :generator @generator = value when :copy_to_output_directory @copy_to_output_directory = value end end |
#compile? ⇒ Boolean
122 123 124 |
# File 'lib/visual_studio_files.rb', line 122 def compile? @type=="Compile" end |
#content? ⇒ Boolean
125 126 127 |
# File 'lib/visual_studio_files.rb', line 125 def content? @type=="Content" end |
#embedded_resource? ⇒ Boolean
128 129 130 |
# File 'lib/visual_studio_files.rb', line 128 def @type=="EmbeddedResource" end |
#hash ⇒ Object
135 136 137 |
# File 'lib/visual_studio_files.rb', line 135 def hash @downcase_and_path_replaced.hash end |
#link? ⇒ Boolean
116 117 118 |
# File 'lib/visual_studio_files.rb', line 116 def link? @link!=nil && !@link.empty? end |
#none? ⇒ Boolean
119 120 121 |
# File 'lib/visual_studio_files.rb', line 119 def none? @type=="None" end |
#page? ⇒ Boolean
131 132 133 |
# File 'lib/visual_studio_files.rb', line 131 def page? @type=="Page" end |
#to_hash ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/visual_studio_files.rb', line 138 def to_hash return { :file=>@file, :type=>@type, :link=>@link, :dependent_upon=>@dependent_upon, :sub_type=>@sub_type, :generator=>@generator, :copy_to_output_directory=>@copy_to_output_directory } end |
#to_s ⇒ Object
149 150 151 |
# File 'lib/visual_studio_files.rb', line 149 def to_s "#{@file} #{@type} #{@link}" end |