Class: Clickwrap::Presenter::Combined
- Inherits:
-
Data
- Object
- Data
- Clickwrap::Presenter::Combined
- Defined in:
- lib/clickwrap/presenter.rb
Overview
The one control and the one sentence a composable policy renders. It is not a statement and never becomes one: the statements it covers keep their own kinds, documents, answers, and lifecycles in the evidence. What this object describes is the offer a person saw.
It answers everything a Statement answers about a CONTROL — the name, the id, the error id, whether it is required, whether it has choices — so the reference views render one control the same way whether it stands for one act or three, and a host's ejected statement partial styles both. What it does not answer is anything about an act, because it is not one.
Instance Attribute Summary collapse
-
#control_id ⇒ Object
readonly
Returns the value of attribute control_id.
-
#control_name ⇒ Object
readonly
Returns the value of attribute control_name.
-
#error_id ⇒ Object
readonly
Returns the value of attribute error_id.
-
#fragments ⇒ Object
readonly
Returns the value of attribute fragments.
-
#joiner ⇒ Object
readonly
Returns the value of attribute joiner.
-
#sentence ⇒ Object
readonly
Returns the value of attribute sentence.
-
#statement_keys ⇒ Object
readonly
Returns the value of attribute statement_keys.
-
#terminator ⇒ Object
readonly
Returns the value of attribute terminator.
Instance Method Summary collapse
-
#answered_as ⇒ Object
The statement whose name the single control carries.
-
#assertion ⇒ Object
The words, without their links.
- #checkbox? ⇒ Boolean
- #choices ⇒ Object
- #covers?(statement_key) ⇒ Boolean
-
#documents ⇒ Object
The links live inside the sentence, so there is no list of documents to render beneath it.
-
#kind ⇒ Object
Composed, so there is no single kind — and "combined" is what the rendered class name should say, because that is what a person is looking at.
- #optional? ⇒ Boolean
-
#required? ⇒ Boolean
Always.
- #requires_an_explicit_choice? ⇒ Boolean
- #withdrawal_path ⇒ Object
Instance Attribute Details
#control_id ⇒ Object (readonly)
Returns the value of attribute control_id
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def control_id @control_id end |
#control_name ⇒ Object (readonly)
Returns the value of attribute control_name
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def control_name @control_name end |
#error_id ⇒ Object (readonly)
Returns the value of attribute error_id
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def error_id @error_id end |
#fragments ⇒ Object (readonly)
Returns the value of attribute fragments
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def fragments @fragments end |
#joiner ⇒ Object (readonly)
Returns the value of attribute joiner
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def joiner @joiner end |
#sentence ⇒ Object (readonly)
Returns the value of attribute sentence
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def sentence @sentence end |
#statement_keys ⇒ Object (readonly)
Returns the value of attribute statement_keys
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def statement_keys @statement_keys end |
#terminator ⇒ Object (readonly)
Returns the value of attribute terminator
57 58 59 |
# File 'lib/clickwrap/presenter.rb', line 57 def terminator @terminator end |
Instance Method Details
#answered_as ⇒ Object
The statement whose name the single control carries. Every covered statement is answered by it; this is the one whose key it is submitted under, so a browser sends one value and the server fans it out.
89 |
# File 'lib/clickwrap/presenter.rb', line 89 def answered_as = statement_keys.first |
#assertion ⇒ Object
The words, without their links. The views render the linked form
through clickwrap_statement_label; this is for anything reading the
offer as text.
79 |
# File 'lib/clickwrap/presenter.rb', line 79 def assertion = sentence |
#checkbox? ⇒ Boolean
67 |
# File 'lib/clickwrap/presenter.rb', line 67 def checkbox? = true |
#choices ⇒ Object
68 |
# File 'lib/clickwrap/presenter.rb', line 68 def choices = nil |
#covers?(statement_key) ⇒ Boolean
59 |
# File 'lib/clickwrap/presenter.rb', line 59 def covers?(statement_key) = statement_keys.include?(statement_key.to_s) |
#documents ⇒ Object
The links live inside the sentence, so there is no list of documents to render beneath it.
83 |
# File 'lib/clickwrap/presenter.rb', line 83 def documents = [].freeze |
#kind ⇒ Object
Composed, so there is no single kind — and "combined" is what the rendered class name should say, because that is what a person is looking at.
74 |
# File 'lib/clickwrap/presenter.rb', line 74 def kind = "combined" |
#optional? ⇒ Boolean
66 |
# File 'lib/clickwrap/presenter.rb', line 66 def optional? = false |
#required? ⇒ Boolean
Always. Only required statements compose, so the single control is
required too — which also lets a custom surface pass this object to
clickwrap_statement_check_box and get the same markup contract a
statement gets.
65 |
# File 'lib/clickwrap/presenter.rb', line 65 def required? = true |
#requires_an_explicit_choice? ⇒ Boolean
69 |
# File 'lib/clickwrap/presenter.rb', line 69 def requires_an_explicit_choice? = false |
#withdrawal_path ⇒ Object
84 |
# File 'lib/clickwrap/presenter.rb', line 84 def withdrawal_path = nil |