Class: VisualStudioFiles::FileReference

Inherits:
Object
  • Object
show all
Defined in:
lib/visual_studio_files.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_directoryObject (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_uponObject (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_replacedObject (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

#fileObject (readonly)

Returns the value of attribute file.



86
87
88
# File 'lib/visual_studio_files.rb', line 86

def file
  @file
end

#generatorObject (readonly)

Returns the value of attribute generator.



86
87
88
# File 'lib/visual_studio_files.rb', line 86

def generator
  @generator
end

Returns the value of attribute link.



86
87
88
# File 'lib/visual_studio_files.rb', line 86

def link
  @link
end

#sub_typeObject (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

#typeObject (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

Returns:

  • (Boolean)


122
123
124
# File 'lib/visual_studio_files.rb', line 122

def compile?
  @type=="Compile"
end

#content?Boolean

Returns:

  • (Boolean)


125
126
127
# File 'lib/visual_studio_files.rb', line 125

def content?
  @type=="Content"
end

#embedded_resource?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/visual_studio_files.rb', line 128

def embedded_resource?
  @type=="EmbeddedResource"
end

#hashObject



135
136
137
# File 'lib/visual_studio_files.rb', line 135

def hash
  @downcase_and_path_replaced.hash
end

#link?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/visual_studio_files.rb', line 116

def link?
  @link!=nil && !@link.empty?
end

#none?Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/visual_studio_files.rb', line 119

def none?
  @type=="None"
end

#page?Boolean

Returns:

  • (Boolean)


131
132
133
# File 'lib/visual_studio_files.rb', line 131

def page?
  @type=="Page"
end

#to_hashObject



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_sObject



149
150
151
# File 'lib/visual_studio_files.rb', line 149

def to_s
  "#{@file} #{@type} #{@link}"
end