Module: LightServices::Base::InstanceMethods
- Included in:
- Service
- Defined in:
- lib/light_services/base.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #execute_method_name ⇒ Object
- #execute_method_options ⇒ Object
- #initialize_class_attributes(args) ⇒ Object
- #initialize_returns_attribute ⇒ Object
- #returns ⇒ Object
- #returns_block ⇒ Object
- #returns_name ⇒ Object
- #setup_returns ⇒ Object
Instance Method Details
#attributes ⇒ Object
48 49 50 |
# File 'lib/light_services/base.rb', line 48 def attributes self.class.get_attributes end |
#execute_method_name ⇒ Object
64 65 66 |
# File 'lib/light_services/base.rb', line 64 def execute_method_name self.class.get_execute_method_name end |
#execute_method_options ⇒ Object
68 69 70 |
# File 'lib/light_services/base.rb', line 68 def self.class. end |
#initialize_class_attributes(args) ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/light_services/base.rb', line 72 def initialize_class_attributes(args) args[0].map do |attr_name, value| if attributes.include? attr_name instance_variable_set("@#{ attr_name }", value) end end end |
#initialize_returns_attribute ⇒ Object
80 81 82 |
# File 'lib/light_services/base.rb', line 80 def initialize_returns_attribute instance_variable_set("@#{ returns_name }", returns) end |
#returns ⇒ Object
52 53 54 |
# File 'lib/light_services/base.rb', line 52 def returns self.class.get_returns end |
#returns_block ⇒ Object
60 61 62 |
# File 'lib/light_services/base.rb', line 60 def returns_block self.class.get_returns_block end |
#returns_name ⇒ Object
56 57 58 |
# File 'lib/light_services/base.rb', line 56 def returns_name self.class.get_returns.to_s.downcase end |
#setup_returns ⇒ Object
84 85 86 |
# File 'lib/light_services/base.rb', line 84 def setup_returns self.instance_exec( returns, &returns_block ) end |