Class: Neutral::VotingBuilder::Structure
- Inherits:
-
Object
- Object
- Neutral::VotingBuilder::Structure
- Defined in:
- lib/neutral/voting_builder/structure.rb
Instance Method Summary collapse
-
#initialize(persisted, difference) ⇒ Structure
constructor
A new instance of Structure.
- #to_a ⇒ Object
Constructor Details
#initialize(persisted, difference) ⇒ Structure
Returns a new instance of Structure.
4 5 6 7 |
# File 'lib/neutral/voting_builder/structure.rb', line 4 def initialize(persisted, difference) @persisted = persisted @difference = difference end |
Instance Method Details
#to_a ⇒ Object
9 10 11 12 13 |
# File 'lib/neutral/voting_builder/structure.rb', line 9 def to_a structure = %w[positive_span positive_link difference_span negative_link negative_span remove_link] structure -= %w[remove_link] unless can_change? structure -= @difference ? %w[positive_span negative_span] : %w[difference_span] end |