Class: EacRubyUtils::Listable::Lists
- Defined in:
- lib/eac_ruby_utils/listable/lists.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #acts_as_listable_items ⇒ Object
-
#initialize(source) ⇒ Lists
constructor
A new instance of Lists.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to_missing?(name, include_all = false) ⇒ Boolean
Constructor Details
#initialize(source) ⇒ Lists
Returns a new instance of Lists.
14 15 16 |
# File 'lib/eac_ruby_utils/listable/lists.rb', line 14 def initialize(source) @source = source end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
24 25 26 27 |
# File 'lib/eac_ruby_utils/listable/lists.rb', line 24 def method_missing(name, *args, &block) list = find_list_by_method(name) list || super end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/eac_ruby_utils/listable/lists.rb', line 12 def source @source end |
Instance Method Details
#acts_as_listable_items ⇒ Object
33 34 35 |
# File 'lib/eac_ruby_utils/listable/lists.rb', line 33 def acts_as_listable_items @acts_as_listable_items ||= ActiveSupport::HashWithIndifferentAccess.new end |
#respond_to_missing?(name, include_all = false) ⇒ Boolean
29 30 31 |
# File 'lib/eac_ruby_utils/listable/lists.rb', line 29 def respond_to_missing?(name, include_all = false) find_list_by_method(name) || super end |