Class: CanvasFactory::ModuleConfig
- Inherits:
-
Object
- Object
- CanvasFactory::ModuleConfig
- Defined in:
- lib/japanda/canvas_factory/module_config.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#require_sequential_progress ⇒ Object
Returns the value of attribute require_sequential_progress.
-
#unlock_at ⇒ Object
Returns the value of attribute unlock_at.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ ModuleConfig
constructor
A new instance of ModuleConfig.
- #request_body ⇒ Object
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
#name ⇒ Object
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_progress ⇒ Object
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_at ⇒ Object
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_body ⇒ Object
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 |