Module: Mumuki::Domain::Helpers::Organization::ClassMethods

Defined in:
lib/mumuki/domain/helpers/organization.rb

Overview

Resource Hash

Instance Method Summary collapse

Instance Method Details

#currentObject



64
65
66
# File 'lib/mumuki/domain/helpers/organization.rb', line 64

def current
  Mumukit::Platform::Organization.current
end

#current?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/mumuki/domain/helpers/organization.rb', line 68

def current?
  Mumukit::Platform::Organization.current?
end

#parse(json) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/mumuki/domain/helpers/organization.rb', line 76

def parse(json)
  json
    .slice(:name)
    .merge(theme: Mumuki::Domain::Organization::Theme.parse(json[:theme]))
    .merge(settings: Mumuki::Domain::Organization::Settings.parse(json[:settings]))
    .merge(profile: Mumuki::Domain::Organization::Profile.parse(json[:profile]))
end

#safe_currentObject



72
73
74
# File 'lib/mumuki/domain/helpers/organization.rb', line 72

def safe_current
  current if current?
end