Class: Monofile::Project

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

Overview

nested class

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Project

todo/fix: change to Monoproject/MonoProject - why? why not?



7
8
9
10
11
12
13
14
15
16
# File 'lib/monofile/monofile.rb', line 7

def initialize( *args )
  if args.size == 1 && args[0].is_a?( String )
    @name = Mononame.parse( args[0] )
  elsif args.size == 2 && args[0].is_a?(String) && args[1].is_a?(String)
    ## assume [org, name]
    @name = Mononame.new( *args )
  else
    raise ArgumentError, "[MonoProject] one or two string args expected; got: #{args.inspect}"
  end
end

Instance Method Details

#nameObject



19
# File 'lib/monofile/monofile.rb', line 19

def name()    @name.name; end

#orgObject



18
# File 'lib/monofile/monofile.rb', line 18

def org()     @name.org; end

#to_pathObject



21
# File 'lib/monofile/monofile.rb', line 21

def to_path() @name.to_path; end

#to_sObject



22
# File 'lib/monofile/monofile.rb', line 22

def to_s()    @name.to_s; end