Class: RideTheStreetcar::SetProperty

Inherits:
Object
  • Object
show all
Includes:
Streamlined::Renderable
Defined in:
lib/ride_the_streetcar/set_property.rb

Instance Method Summary collapse

Constructor Details

#initialize(object_chain, value) ⇒ SetProperty

Returns a new instance of SetProperty.



5
6
7
8
# File 'lib/ride_the_streetcar/set_property.rb', line 5

def initialize(object_chain, value)
  @object_chain = object_chain
  @value = value.to_json
end

Instance Method Details

#templateObject



10
11
12
13
14
15
# File 'lib/ride_the_streetcar/set_property.rb', line 10

def template
  html -> { <<~HTML
    <sc-set-property name="#{text->{ @object_chain }}" value="#{text->{ @value }}"></sc-set-property>
  HTML
  }
end