Module: LicenceToBill::Concerns

Includes:
Helpers
Included in:
Deal, Feature, Offer, Stage, User, UserAddress
Defined in:
lib/licencetobill/concerns.rb

Instance Method Summary collapse

Methods included from Helpers

#get_collection

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



10
11
12
13
# File 'lib/licencetobill/concerns.rb', line 10

def method_missing(method_name)
  super unless @data_source.has_key?("#{method_name}")
  @data_source["#{method_name}"]
end

Instance Method Details

#initialize(data_source) ⇒ Object



6
7
8
# File 'lib/licencetobill/concerns.rb', line 6

def initialize(data_source)
  @data_source = data_source
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/licencetobill/concerns.rb', line 15

def respond_to_missing?(method_name, include_private = false)
  @data_source.has_key?("#{method_name}") || super
end