Class: Neutral::VotingBuilder::Builder
- Inherits:
-
Object
- Object
- Neutral::VotingBuilder::Builder
- Includes:
- ActionView::Helpers::OutputSafetyHelper, ActionView::Helpers::TagHelper, Elements
- Defined in:
- lib/neutral/voting_builder/builder.rb
Instance Attribute Summary collapse
-
#difference ⇒ Object
readonly
Returns the value of attribute difference.
-
#icons ⇒ Object
readonly
Returns the value of attribute icons.
-
#voteable ⇒ Object
readonly
Returns the value of attribute voteable.
-
#voter ⇒ Object
readonly
Returns the value of attribute voter.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(voteable, options) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(voteable, options) ⇒ Builder
9 10 11 12 13 14 |
# File 'lib/neutral/voting_builder/builder.rb', line 9 def initialize(voteable, ) @voteable = voteable @voter = [:voter] @icons = [:icons] || Neutral.config.default_icon_set @difference = [:difference] end |
Instance Attribute Details
#difference ⇒ Object (readonly)
Returns the value of attribute difference.
8 9 10 |
# File 'lib/neutral/voting_builder/builder.rb', line 8 def difference @difference end |
#icons ⇒ Object (readonly)
Returns the value of attribute icons.
8 9 10 |
# File 'lib/neutral/voting_builder/builder.rb', line 8 def icons @icons end |
#voteable ⇒ Object (readonly)
Returns the value of attribute voteable.
8 9 10 |
# File 'lib/neutral/voting_builder/builder.rb', line 8 def voteable @voteable end |
#voter ⇒ Object (readonly)
Returns the value of attribute voter.
8 9 10 |
# File 'lib/neutral/voting_builder/builder.rb', line 8 def voter @voter end |
Instance Method Details
#build ⇒ Object
16 17 18 |
# File 'lib/neutral/voting_builder/builder.rb', line 16 def build content_tag :div, elements, class: 'neutral' end |