Class: Dox::Entities::Action
- Inherits:
-
Object
- Object
- Dox::Entities::Action
- Defined in:
- lib/dox/entities/action.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#examples ⇒ Object
Returns the value of attribute examples.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(details, request) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(details, request) ⇒ Action
Returns a new instance of Action.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dox/entities/action.rb', line 7 def initialize(details, request) @request = request @name = details[:action_name] @resource = details[:resource_name] @desc = details[:action_desc] @verb = details[:action_verb] || request.method @path = details[:action_path] || template_path @params = template_params(details[:action_params], details[:action_query_params] || []) @examples = [] validate! end |
Instance Attribute Details
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def desc @desc end |
#examples ⇒ Object
Returns the value of attribute examples.
5 6 7 |
# File 'lib/dox/entities/action.rb', line 5 def examples @examples end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def path @path end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def resource @resource end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
4 5 6 |
# File 'lib/dox/entities/action.rb', line 4 def verb @verb end |