Class: EasyCreds::Projects::Project

Inherits:
Data
  • Object
show all
Defined in:
lib/easy_creds/projects/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#github_urlObject (readonly)

Returns the value of attribute github_url

Returns:

  • (Object)

    the current value of github_url



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def github_url
  @github_url
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def kind
  @kind
end

#last_seen_atObject (readonly)

Returns the value of attribute last_seen_at

Returns:

  • (Object)

    the current value of last_seen_at



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def last_seen_at
  @last_seen_at
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def path
  @path
end

#registered_atObject (readonly)

Returns the value of attribute registered_at

Returns:

  • (Object)

    the current value of registered_at



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def registered_at
  @registered_at
end

#templateObject (readonly)

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template



5
6
7
# File 'lib/easy_creds/projects/registry.rb', line 5

def template
  @template
end

Instance Method Details

#display_pathObject



9
# File 'lib/easy_creds/projects/registry.rb', line 9

def display_path    = path.sub(Dir.home, '~')

#exists_on_disk?Boolean

Returns:

  • (Boolean)


8
# File 'lib/easy_creds/projects/registry.rb', line 8

def exists_on_disk? = File.directory?(path)

#rails?Boolean

Returns:

  • (Boolean)


10
# File 'lib/easy_creds/projects/registry.rb', line 10

def rails?          = kind == :rails

#to_h_yamlObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/easy_creds/projects/registry.rb', line 12

def to_h_yaml
  {
    'name'          => name,
    'path'          => path,
    'kind'          => kind.to_s,
    'github_url'    => github_url,
    'template'      => template&.to_s,
    'last_seen_at'  => last_seen_at&.iso8601,
    'registered_at' => registered_at&.iso8601
  }.compact
end