Class: RocketDocs::Documentation::Controller
- Inherits:
-
Object
- Object
- RocketDocs::Documentation::Controller
- Defined in:
- lib/rocket_docs/documentation/controller.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#documentation ⇒ Object
readonly
Returns the value of attribute documentation.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(name, file, actions_hash, documentation) ⇒ Controller
constructor
A new instance of Controller.
- #should_update? ⇒ Boolean
- #update ⇒ Object
- #update! ⇒ Object
Constructor Details
#initialize(name, file, actions_hash, documentation) ⇒ Controller
Returns a new instance of Controller.
9 10 11 12 13 14 15 16 17 |
# File 'lib/rocket_docs/documentation/controller.rb', line 9 def initialize(name, file, actions_hash, documentation) @file_md5 = '' @actions = [] @actions_in = actions_hash self.name = name self.file = file @documentation = documentation update! end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
7 8 9 |
# File 'lib/rocket_docs/documentation/controller.rb', line 7 def actions @actions end |
#documentation ⇒ Object (readonly)
Returns the value of attribute documentation.
6 7 8 |
# File 'lib/rocket_docs/documentation/controller.rb', line 6 def documentation @documentation end |
#file ⇒ Object
Returns the value of attribute file.
5 6 7 |
# File 'lib/rocket_docs/documentation/controller.rb', line 5 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/rocket_docs/documentation/controller.rb', line 4 def name @name end |
Instance Method Details
#full_name ⇒ Object
38 39 40 |
# File 'lib/rocket_docs/documentation/controller.rb', line 38 def full_name @name end |
#should_update? ⇒ Boolean
28 29 30 31 |
# File 'lib/rocket_docs/documentation/controller.rb', line 28 def should_update? return false if generate_hash == @file_md5 true end |
#update ⇒ Object
19 20 21 |
# File 'lib/rocket_docs/documentation/controller.rb', line 19 def update should_update? && update! end |
#update! ⇒ Object
23 24 25 26 |
# File 'lib/rocket_docs/documentation/controller.rb', line 23 def update! @file_md5 = generate_hash generate end |