Class: ReactOnRailsPro::RendererArtifact::Identity
- Inherits:
-
Data
- Object
- Data
- ReactOnRailsPro::RendererArtifact::Identity
- Defined in:
- lib/react_on_rails_pro/renderer_artifact.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(role:, id:) ⇒ Identity
constructor
A new instance of Identity.
Constructor Details
#initialize(role:, id:) ⇒ Identity
Returns a new instance of Identity.
31 32 33 34 35 36 37 38 39 |
# File 'lib/react_on_rails_pro/renderer_artifact.rb', line 31 def initialize(role:, id:) normalized_role = role.to_sym normalized_id = id.to_s.freeze unless RendererArtifact.role_from_id(normalized_id) == normalized_role raise ArgumentError, "Renderer artifact identity does not match role #{normalized_role.inspect}" end super(role: normalized_role, id: normalized_id) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id
30 31 32 |
# File 'lib/react_on_rails_pro/renderer_artifact.rb', line 30 def id @id end |
#role ⇒ Object (readonly)
Returns the value of attribute role
30 31 32 |
# File 'lib/react_on_rails_pro/renderer_artifact.rb', line 30 def role @role end |