Class: DataMapper::YS::Config
- Inherits:
-
Object
- Object
- DataMapper::YS::Config
- Defined in:
- lib/dm-ys/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(options = nil) ⇒ Config
constructor
A new instance of Config.
- #only_path? ⇒ Boolean
- #uniq_entry? ⇒ Boolean
- #uniq_page? ⇒ Boolean
Constructor Details
#initialize(options = nil) ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/dm-ys/config.rb', line 8 def initialize( = nil) @options = @options = self.class.default unless @options.is_a?(Hash) end |
Class Method Details
.default ⇒ Object
4 5 6 |
# File 'lib/dm-ys/config.rb', line 4 def self.default {:max_pages=>100, :uniq=>true, :only_path=>false} end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 |
# File 'lib/dm-ys/config.rb', line 13 def [](key) @options[key] end |
#[]=(key, val) ⇒ Object
17 18 19 |
# File 'lib/dm-ys/config.rb', line 17 def []=(key, val) @options[key] = val end |
#only_path? ⇒ Boolean
29 30 31 |
# File 'lib/dm-ys/config.rb', line 29 def only_path? !!self[:only_path] end |
#uniq_entry? ⇒ Boolean
25 26 27 |
# File 'lib/dm-ys/config.rb', line 25 def uniq_entry? self[:uniq] == true or self[:uniq] == :entry end |
#uniq_page? ⇒ Boolean
21 22 23 |
# File 'lib/dm-ys/config.rb', line 21 def uniq_page? !!self[:uniq] end |