Class: CsProj::Msbuild::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/csproj/msbuild/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Project

Returns a new instance of Project.



6
7
8
# File 'lib/csproj/msbuild/project.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/csproj/msbuild/project.rb', line 4

def options
  @options
end

Instance Method Details

#android?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/csproj/msbuild/project.rb', line 26

def android?
  is_platform? CsProj::Platform::ANDROID
end

#ios?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/csproj/msbuild/project.rb', line 18

def ios?
  is_platform? CsProj::Platform::IOS
end

#is_platform?(platform) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
38
39
40
# File 'lib/csproj/msbuild/project.rb', line 30

def is_platform?(platform)
  case platform
         when CsProj::Platform::IOS
      then project_name.downcase.include? "ios"
         when CsProj::Platform::OSX
      then project_name.downcase.include? "mac"
         when CsProj::Platform::ANDROID
      then project_name.downcase.include? "droid"
         else false
  end
end

#osx?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/csproj/msbuild/project.rb', line 22

def osx?
  is_platform? CsProj::Platform::OSX
end

#project_nameObject



10
11
12
# File 'lib/csproj/msbuild/project.rb', line 10

def project_name
  @options[:project_name]
end

#project_pathObject



14
15
16
# File 'lib/csproj/msbuild/project.rb', line 14

def project_path
  @options[:project_path]
end