Class: Plushie::Event::Sensor

Inherits:
Data
  • Object
show all
Defined in:
lib/plushie/event.rb

Overview

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, id:, width: nil, height: nil, scope: []) ⇒ Sensor

Returns a new instance of Sensor.



234
235
236
# File 'lib/plushie/event.rb', line 234

def initialize(type:, id:, width: nil, height: nil, scope: [])
  super
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



233
234
235
# File 'lib/plushie/event.rb', line 233

def height
  @height
end

#height [Float, nil] measured height([Float, nil]) ⇒ Object (readonly)

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]


233
234
235
236
237
# File 'lib/plushie/event.rb', line 233

Sensor = Data.define(:type, :id, :width, :height, :scope) do
  def initialize(type:, id:, width: nil, height: nil, scope: [])
    super
  end
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



233
234
235
# File 'lib/plushie/event.rb', line 233

def id
  @id
end

#id [String] sensor widget ID([String]) ⇒ Object (readonly)

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]


233
234
235
236
237
# File 'lib/plushie/event.rb', line 233

Sensor = Data.define(:type, :id, :width, :height, :scope) do
  def initialize(type:, id:, width: nil, height: nil, scope: [])
    super
  end
end

#scopeObject (readonly)

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



233
234
235
# File 'lib/plushie/event.rb', line 233

def scope
  @scope
end

#scope [Array<String>] reversed ancestor scope chain([Array<String>]) ⇒ Object (readonly)

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]


233
234
235
236
237
# File 'lib/plushie/event.rb', line 233

Sensor = Data.define(:type, :id, :width, :height, :scope) do
  def initialize(type:, id:, width: nil, height: nil, scope: [])
    super
  end
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



233
234
235
# File 'lib/plushie/event.rb', line 233

def type
  @type
end

#type [Symbol] :resized([Symbol]) ⇒ Object (readonly)

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]


233
234
235
236
237
# File 'lib/plushie/event.rb', line 233

Sensor = Data.define(:type, :id, :width, :height, :scope) do
  def initialize(type:, id:, width: nil, height: nil, scope: [])
    super
  end
end

#widthObject (readonly)

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



233
234
235
# File 'lib/plushie/event.rb', line 233

def width
  @width
end

#width [Float, nil] measured width([Float, nil]) ⇒ Object (readonly)

Sensor events for detecting widget size changes. Triggered when a sensor widget's measured dimensions change.

Examples:

Sensor resized

in Event::Sensor[type: :resized, id: "content_area", width:, height:]


233
234
235
236
237
# File 'lib/plushie/event.rb', line 233

Sensor = Data.define(:type, :id, :width, :height, :scope) do
  def initialize(type:, id:, width: nil, height: nil, scope: [])
    super
  end
end