Module: Card::Set::Abstract::Pointer::OptionsApi
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb
Overview
Set: Abstract (Pointer, OptionsApi)
TODO: some of this should be moved to right/options!!
Defined Under Namespace
Modules: Format, HtmlFormat
Constant Summary
Constants included from Helpers
Helpers::SET_PATTERN_TEST_REGEXP
Class Method Summary collapse
Instance Method Summary collapse
- #json_options? ⇒ Boolean
- #option_cards ⇒ Object
- #option_hash_from_names ⇒ Object
- #option_names ⇒ Object
- #option_names_from_items ⇒ Object
- #options_card ⇒ Object
- #options_card_name ⇒ Object
- #options_hash ⇒ Object
- #options_rule_card ⇒ Object
- #standard_option_names ⇒ Object
Methods included from Card::Set
Methods included from I18nScope
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set
Methods included from Helpers
#method_missing, #num_set_parts, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscore
Methods included from Card::Set::AdvancedApi
#attachment, #ensure_set, #stage_method
Methods included from Format
#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Basket
#abstract_basket, #add_to_basket, #basket, #unshift_basket
Methods included from Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Class Method Details
.source_location ⇒ Object
8 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 8 def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/pointer/set/abstract/02_pointer/options_api.rb"; end |
Instance Method Details
#json_options? ⇒ Boolean
14 15 16 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 14 def &.type_id == Card::JsonID end |
#option_cards ⇒ Object
32 33 34 35 36 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 32 def option_cards option_names.map do |name| Card.fetch name, new: {} end end |
#option_hash_from_names ⇒ Object
18 19 20 21 22 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 18 def option_hash_from_names option_names.each_with_object({}) do |name, hash| hash[name] = name end end |
#option_names ⇒ Object
24 25 26 27 28 29 30 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 24 def option_names if ( = item_names) (standard_option_names + ).uniq else standard_option_names end end |
#option_names_from_items ⇒ Object
50 51 52 53 54 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 50 def option_names_from_items o_card = limit = o_card.try(:default_limit).to_i o_card.item_names context: name, limit: limit end |
#options_card ⇒ Object
56 57 58 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 56 def || Card[:all] end |
#options_card_name ⇒ Object
60 61 62 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 60 def &.name&.url_key || ":all" end |
#options_hash ⇒ Object
10 11 12 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 10 def ? .parse_content : option_hash_from_names end |
#options_rule_card ⇒ Object
38 39 40 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 38 def rule_card :options end |
#standard_option_names ⇒ Object
42 43 44 45 46 47 48 |
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/options_api.rb', line 42 def standard_option_names if .values.map(&:to_name) else option_names_from_items end end |