mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-02-21 12:10:34 +09:00
20 lines
337 B
Ruby
20 lines
337 B
Ruby
class Purchaser
|
|
def initialize
|
|
load_configuration
|
|
end
|
|
|
|
def registered?
|
|
@purchased_by.present?
|
|
end
|
|
|
|
def name
|
|
@purchased_by["name"] if registered?
|
|
end
|
|
|
|
private
|
|
def load_configuration
|
|
path = Rails.root.join("config/purchased_by.yml")
|
|
@purchased_by = YAML.load_file(path) if path.exist?
|
|
end
|
|
end
|