Class: Neutral::VotingBuilder::Builder

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::OutputSafetyHelper, ActionView::Helpers::TagHelper, Elements
Defined in:
lib/neutral/voting_builder/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(voteable, options) ⇒ Builder



9
10
11
12
13
14
# File 'lib/neutral/voting_builder/builder.rb', line 9

def initialize(voteable, options)
  @voteable = voteable
  @voter = options[:voter]
  @icons = options[:icons] || Neutral.config.default_icon_set
  @difference = options[:difference]
end

Instance Attribute Details

#differenceObject (readonly)

Returns the value of attribute difference.



8
9
10
# File 'lib/neutral/voting_builder/builder.rb', line 8

def difference
  @difference
end

#iconsObject (readonly)

Returns the value of attribute icons.



8
9
10
# File 'lib/neutral/voting_builder/builder.rb', line 8

def icons
  @icons
end

#voteableObject (readonly)

Returns the value of attribute voteable.



8
9
10
# File 'lib/neutral/voting_builder/builder.rb', line 8

def voteable
  @voteable
end

#voterObject (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

#buildObject



16
17
18
# File 'lib/neutral/voting_builder/builder.rb', line 16

def build
   :div, elements, class: 'neutral'
end