Class: Dox::Entities::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/dox/entities/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descObject (readonly)

Returns the value of attribute desc.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def desc
  @desc
end

#examplesObject

Returns the value of attribute examples.



5
6
7
# File 'lib/dox/entities/action.rb', line 5

def examples
  @examples
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def path
  @path
end

#resourceObject (readonly)

Returns the value of attribute resource.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def resource
  @resource
end

#verbObject (readonly)

Returns the value of attribute verb.



4
5
6
# File 'lib/dox/entities/action.rb', line 4

def verb
  @verb
end