Class: Slotify::ValueOptions

Inherits:
ActiveSupport::OrderedOptions
  • Object
show all
Defined in:
lib/slotify/value_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(view_context, options = {}) ⇒ ValueOptions

Returns a new instance of ValueOptions.



3
4
5
6
# File 'lib/slotify/value_options.rb', line 3

def initialize(view_context, options = {})
  @view_context = view_context
  merge!(options)
end

Instance Method Details

#exceptObject



8
9
10
# File 'lib/slotify/value_options.rb', line 8

def except(...)
  ValueOptions.new(@view_context, to_h.except(...))
end

#sliceObject



12
13
14
# File 'lib/slotify/value_options.rb', line 12

def slice(...)
  ValueOptions.new(@view_context, to_h.slice(...))
end

#to_sObject



16
17
18
# File 'lib/slotify/value_options.rb', line 16

def to_s
  @view_context.tag.attributes(self)
end