Class: Sod::Models::Action
- Inherits:
-
Data
- Object
- Data
- Sod::Models::Action
- Defined in:
- lib/sod/models/action.rb
Overview
Defines all attributes of an action.
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#allow ⇒ Object
readonly
Returns the value of attribute allow.
-
#ancillary ⇒ Object
readonly
Returns the value of attribute ancillary.
-
#argument ⇒ Object
readonly
Returns the value of attribute argument.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(aliases: nil, argument: nil, type: nil, allow: nil, default: nil, description: nil, ancillary: nil) ⇒ Action
constructor
A new instance of Action.
- #to_a ⇒ Object
Constructor Details
#initialize(aliases: nil, argument: nil, type: nil, allow: nil, default: nil, description: nil, ancillary: nil) ⇒ Action
Returns a new instance of Action.
19 20 21 22 23 24 25 26 27 |
# File 'lib/sod/models/action.rb', line 19 def initialize aliases: nil, argument: nil, type: nil, allow: nil, default: nil, description: nil, ancillary: nil super end |
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def aliases @aliases end |
#allow ⇒ Object (readonly)
Returns the value of attribute allow
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def allow @allow end |
#ancillary ⇒ Object (readonly)
Returns the value of attribute ancillary
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def ancillary @ancillary end |
#argument ⇒ Object (readonly)
Returns the value of attribute argument
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def argument @argument end |
#default ⇒ Object (readonly)
Returns the value of attribute default
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def description @description end |
#type ⇒ Object (readonly)
Returns the value of attribute type
8 9 10 |
# File 'lib/sod/models/action.rb', line 8 def type @type end |
Instance Method Details
#handle ⇒ Object
29 |
# File 'lib/sod/models/action.rb', line 29 def handle = [Array(aliases).join(", "), argument].tap(&:compact!).join " " |
#to_a ⇒ Object
31 |
# File 'lib/sod/models/action.rb', line 31 def to_a = [*handles, type, allow, description, *ancillary].tap(&:compress!) |