Class: Almicube::Builder
- Inherits:
-
Object
- Object
- Almicube::Builder
- Defined in:
- lib/almicube/builder.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
-
#bundler ⇒ Object
Returns the value of attribute bundler.
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#date ⇒ Object
Returns the value of attribute date.
-
#selector ⇒ Object
Returns the value of attribute selector.
Instance Method Summary collapse
- #data(date = nil) ⇒ Object
-
#initialize(options = {}) ⇒ Builder
constructor
A new instance of Builder.
- #options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 9 10 11 |
# File 'lib/almicube/builder.rb', line 5 def initialize(={}) @class_name = [:class_name] @attribute_name = [:attribute_name] @selector = select_selector([:selector]) @bundler = select_bundler([:bundler]) @date = [:date] || Date.today end |
Instance Attribute Details
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
3 4 5 |
# File 'lib/almicube/builder.rb', line 3 def attribute_name @attribute_name end |
#bundler ⇒ Object
Returns the value of attribute bundler.
3 4 5 |
# File 'lib/almicube/builder.rb', line 3 def bundler @bundler end |
#class_name ⇒ Object
Returns the value of attribute class_name.
3 4 5 |
# File 'lib/almicube/builder.rb', line 3 def class_name @class_name end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/almicube/builder.rb', line 3 def date @date end |
#selector ⇒ Object
Returns the value of attribute selector.
3 4 5 |
# File 'lib/almicube/builder.rb', line 3 def selector @selector end |
Instance Method Details
#data(date = nil) ⇒ Object
13 14 15 16 |
# File 'lib/almicube/builder.rb', line 13 def data(date=nil) date ||= self.date Almicube::Ranking::DataRanking.new .merge( date: date ) end |
#options ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/almicube/builder.rb', line 18 def { selector: selector, bundler: bundler, date: date, class_name: class_name, attribute_name: attribute_name } end |