Module: LightServices::Base::InstanceMethods

Included in:
Service
Defined in:
lib/light_services/base.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



48
49
50
# File 'lib/light_services/base.rb', line 48

def attributes
  self.class.get_attributes
end

#execute_method_nameObject



64
65
66
# File 'lib/light_services/base.rb', line 64

def execute_method_name
  self.class.get_execute_method_name
end

#execute_method_optionsObject



68
69
70
# File 'lib/light_services/base.rb', line 68

def execute_method_options
  self.class.get_execute_method_options
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_attributeObject



80
81
82
# File 'lib/light_services/base.rb', line 80

def initialize_returns_attribute
  instance_variable_set("@#{ returns_name }", returns)
end

#returnsObject



52
53
54
# File 'lib/light_services/base.rb', line 52

def returns
  self.class.get_returns
end

#returns_blockObject



60
61
62
# File 'lib/light_services/base.rb', line 60

def returns_block
  self.class.get_returns_block
end

#returns_nameObject



56
57
58
# File 'lib/light_services/base.rb', line 56

def returns_name
  self.class.get_returns.to_s.downcase
end

#setup_returnsObject



84
85
86
# File 'lib/light_services/base.rb', line 84

def setup_returns
  self.instance_exec( returns, &returns_block )
end