Class: OpenSource::License::Owner

Inherits:
Object
  • Object
show all
Defined in:
lib/open_source/license/owner.rb

Instance Method Summary collapse

Instance Method Details

#credentialsObject



14
15
16
# File 'lib/open_source/license/owner.rb', line 14

def credentials
  @credentials ||= YAML.load_file(CONFIG_PATH)
end

#credentials=(credentials) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/open_source/license/owner.rb', line 6

def credentials=(credentials)
  config_file = File.new(CONFIG_PATH, 'w')
  file_contents = YAML.dump(credentials)
  config_file.write(file_contents)
rescue StandardError => ex
  OpenSource.logger.fatal("Unable to access #{CONFIG_PATH}")
end

#emailObject



18
19
20
# File 'lib/open_source/license/owner.rb', line 18

def email
  credentials[:email]
end

#markdown_supported_emailObject



22
23
24
# File 'lib/open_source/license/owner.rb', line 22

def markdown_supported_email
  "<#{credentials[:email]}>"
end

#nameObject



26
27
28
# File 'lib/open_source/license/owner.rb', line 26

def name
  credentials[:name]
end