Class: Metro::Model::OptionsProperty

Inherits:
Property
  • Object
show all
Defined in:
lib/metro/models/properties/options_property/options_property.rb,
lib/metro/models/properties/options_property/options.rb,
lib/metro/models/properties/options_property/no_option.rb

Overview

An options property is a property that takes scene or view defined values and converts them into an Options object.

Examples:

A simple array of option names


options: [ 'Start Game', 'Exit' ]

A set of option names with a selection


options:
  selected: 0
  items: [ 'Start Game', 'Exit' ]

A complex set of options


options:
  selected: 1
  items:
  -
    model: "metro::ui::label"
    text: "Start Game"
    action: start_game
  -
    model: metro::ui::label
    text: Exit
    action: exit_game

See Also:

Defined Under Namespace

Classes: NoOption, Options

Constant Summary

Constants included from Units

Units::Bounds

Instance Attribute Summary

Attributes inherited from Property

#block, #model, #options

Method Summary

Methods inherited from Property

define_property, defined_properties, get, #get, get_or_set, gets, hash_with_default_to_nil, inherited, #initialize, properties, properties_hash, property, #set, set, sets

Constructor Details

This class inherits a constructor from Metro::Model::Property