Class: Coupdoeil::Popover::Setup
- Inherits:
-
Object
- Object
- Coupdoeil::Popover::Setup
- Defined in:
- app/models/coupdoeil/popover/setup.rb
Constant Summary collapse
- EMPTY_PARAMS =
{}.freeze
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(klass) ⇒ Setup
constructor
A new instance of Setup.
- #options ⇒ Object
- #render_in(view_context) ⇒ Object
- #with_options(new_options) ⇒ Object
- #with_params(**params) ⇒ Object
- #with_type(type) ⇒ Object
Constructor Details
#initialize(klass) ⇒ Setup
Returns a new instance of Setup.
10 11 12 13 14 |
# File 'app/models/coupdoeil/popover/setup.rb', line 10 def initialize(klass) @klass = klass @type = nil @params = EMPTY_PARAMS end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
6 7 8 |
# File 'app/models/coupdoeil/popover/setup.rb', line 6 def klass @klass end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'app/models/coupdoeil/popover/setup.rb', line 6 def params @params end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'app/models/coupdoeil/popover/setup.rb', line 6 def type @type end |
Instance Method Details
#identifier ⇒ Object
16 |
# File 'app/models/coupdoeil/popover/setup.rb', line 16 def identifier = "#{type}@#{klass.popover_resource_name}" |
#options ⇒ Object
18 |
# File 'app/models/coupdoeil/popover/setup.rb', line 18 def = @options ||= klass.(type) |
#render_in(view_context) ⇒ Object
17 |
# File 'app/models/coupdoeil/popover/setup.rb', line 17 def render_in(view_context) = klass.new(params, view_context).process(type) |
#with_options(new_options) ⇒ Object
30 31 32 33 |
# File 'app/models/coupdoeil/popover/setup.rb', line 30 def () @options = .merge(Popover::OptionsSet.new()) self end |
#with_params(**params) ⇒ Object
25 26 27 28 |
# File 'app/models/coupdoeil/popover/setup.rb', line 25 def with_params(**params) @params = params self end |
#with_type(type) ⇒ Object
20 21 22 23 |
# File 'app/models/coupdoeil/popover/setup.rb', line 20 def with_type(type) @type = type self end |