Class: Referee::Storyboard
- Inherits:
-
Renderable
- Object
- Renderable
- Referee::Storyboard
- Defined in:
- lib/referee/renderables/storyboard.rb
Overview
Renderable implementation for UIStoryboards in a project.
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Renderable
Instance Method Summary collapse
- #declaration ⇒ Object
- #implementation ⇒ Object
-
#initialize(name, config) ⇒ Storyboard
constructor
A new instance of Storyboard.
- #swift_implementation ⇒ Object
Methods inherited from Renderable
#bundle_accessor, #methodize_name, #simple_method_declaration, #simple_method_implementation, #simple_swift_method, #simple_swift_string_case, #swift_bundle_accessor
Constructor Details
#initialize(name, config) ⇒ Storyboard
Returns a new instance of Storyboard.
6 7 8 9 10 11 |
# File 'lib/referee/renderables/storyboard.rb', line 6 def initialize(name, config) @name = name @type = 'UIStoryboard *' @swift_type = 'UIStoryboard' @config = config end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/referee/renderables/storyboard.rb', line 4 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/referee/renderables/storyboard.rb', line 4 def name @name end |
Instance Method Details
#declaration ⇒ Object
13 14 15 |
# File 'lib/referee/renderables/storyboard.rb', line 13 def declaration simple_method_declaration @name end |
#implementation ⇒ Object
17 18 19 20 21 |
# File 'lib/referee/renderables/storyboard.rb', line 17 def implementation bundle = bundle_accessor(@config.bundle_id) body = "[UIStoryboard storyboardWithName:@\"#{@name}\" bundle:#{bundle}]" simple_method_implementation @name, body end |
#swift_implementation ⇒ Object
23 24 25 26 27 |
# File 'lib/referee/renderables/storyboard.rb', line 23 def swift_implementation bundle = swift_bundle_accessor(@config.bundle_id) body = "UIStoryboard(name: \"#{@name}\", bundle: #{bundle})" simple_swift_method @name, body end |