Class: VisualStudioFiles::FileReference
- Inherits:
-
Object
- Object
- VisualStudioFiles::FileReference
- Defined in:
- lib/visual_studio_files.rb
Instance Attribute Summary collapse
-
#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.
77 78 79 80 81 |
# File 'lib/visual_studio_files.rb', line 77 def initialize opts opts.each do |key,value| self[key]=value end end |
Instance Attribute Details
#dependent_upon ⇒ Object (readonly)
Returns the value of attribute dependent_upon.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def dependent_upon @dependent_upon end |
#downcase_and_path_replaced ⇒ Object (readonly)
Returns the value of attribute downcase_and_path_replaced.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def downcase_and_path_replaced @downcase_and_path_replaced end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def file @file end |
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def generator @generator end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def link @link end |
#sub_type ⇒ Object (readonly)
Returns the value of attribute sub_type.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def sub_type @sub_type end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
76 77 78 |
# File 'lib/visual_studio_files.rb', line 76 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
85 86 87 |
# File 'lib/visual_studio_files.rb', line 85 def ==(other) other.downcase_and_path_replaced == @downcase_and_path_replaced end |
#[]=(idx, value) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/visual_studio_files.rb', line 88 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 end end |
#compile? ⇒ Boolean
110 111 112 |
# File 'lib/visual_studio_files.rb', line 110 def compile? @type=="Compile" end |
#content? ⇒ Boolean
113 114 115 |
# File 'lib/visual_studio_files.rb', line 113 def content? @type=="Content" end |
#embedded_resource? ⇒ Boolean
116 117 118 |
# File 'lib/visual_studio_files.rb', line 116 def @type=="EmbeddedResource" end |
#hash ⇒ Object
123 124 125 |
# File 'lib/visual_studio_files.rb', line 123 def hash @downcase_and_path_replaced.hash end |
#link? ⇒ Boolean
104 105 106 |
# File 'lib/visual_studio_files.rb', line 104 def link? @link!=nil && !@link.empty? end |
#none? ⇒ Boolean
107 108 109 |
# File 'lib/visual_studio_files.rb', line 107 def none? @type=="None" end |
#page? ⇒ Boolean
119 120 121 |
# File 'lib/visual_studio_files.rb', line 119 def page? @type=="Page" end |
#to_hash ⇒ Object
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/visual_studio_files.rb', line 126 def to_hash return { :file=>@file, :type=>@type, :link=>@link, :dependent_upon=>@dependent_upon, :sub_type=>@sub_type, :generator=>@generator } end |
#to_s ⇒ Object
136 137 138 |
# File 'lib/visual_studio_files.rb', line 136 def to_s "#{@file} #{@type} #{@link}" end |