Class: CanvasFactory::ModuleConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/japanda/canvas_factory/module_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ModuleConfig

Returns a new instance of ModuleConfig.



5
6
7
8
9
10
# File 'lib/japanda/canvas_factory/module_config.rb', line 5

def initialize(opts = {})
  @name = opts[:name] || "module-#{Time.now.to_i}"
  @unlock_at = opts[:unlock_at] || DateTime.now.iso8601
  @require_sequential_progress = opts[:require_sequential_progress] || true
  @published = opts[:published] || true
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/japanda/canvas_factory/module_config.rb', line 3

def name
  @name
end

#require_sequential_progressObject

Returns the value of attribute require_sequential_progress.



3
4
5
# File 'lib/japanda/canvas_factory/module_config.rb', line 3

def require_sequential_progress
  @require_sequential_progress
end

#unlock_atObject

Returns the value of attribute unlock_at.



3
4
5
# File 'lib/japanda/canvas_factory/module_config.rb', line 3

def unlock_at
  @unlock_at
end

Instance Method Details

#request_bodyObject



12
13
14
15
16
17
18
19
20
# File 'lib/japanda/canvas_factory/module_config.rb', line 12

def request_body
  {
    module: {
      name: @name,
      unlock_at: @unlock_at,
      require_sequential_progress: @require_sequential_progress
    }
  }
end