Class: ActionService::Base
- Inherits:
-
Object
- Object
- ActionService::Base
- Defined in:
- lib/action_service/base.rb
Class Method Summary collapse
- .export(name, options = {}) ⇒ Object
- .exports ⇒ Object
- .has_export?(name) ⇒ Boolean
- .has_public_export?(name) ⇒ Boolean
- .internal_export_name(public_name) ⇒ Object
- .public_export_name(export_name) ⇒ Object
Class Method Details
.export(name, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/action_service/base.rb', line 14 def export(name, ={}) ([:expects, :returns, :expects_and_returns], .keys) if [:expects_and_returns] expects = [:expects_and_returns] returns = [:expects_and_returns] else expects = [:expects] returns = [:returns] end name = name.to_sym public_name = public_export_name(name) info = { :expects => expects, :returns => returns } write_inheritable_hash("action_service_exports", name => info) write_inheritable_hash("action_service_public_exports", public_name => name) end |
.exports ⇒ Object
50 51 52 |
# File 'lib/action_service/base.rb', line 50 def exports read_inheritable_attribute("action_service_exports") || {} end |
.has_export?(name) ⇒ Boolean
30 31 32 |
# File 'lib/action_service/base.rb', line 30 def has_export?(name) exports.has_key?(name) end |
.has_public_export?(name) ⇒ Boolean
34 35 36 |
# File 'lib/action_service/base.rb', line 34 def has_public_export?(name) public_exports.has_key?(name) end |
.internal_export_name(public_name) ⇒ Object
46 47 48 |
# File 'lib/action_service/base.rb', line 46 def internal_export_name(public_name) public_exports[public_name] end |
.public_export_name(export_name) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/action_service/base.rb', line 38 def public_export_name(export_name) if export_name_mangling Inflector.camelize(export_name.to_s) else export_name.to_s end end |