Class: Swiftfake::Presenter
- Inherits:
-
Object
- Object
- Swiftfake::Presenter
- Defined in:
- lib/swiftfake/presenter.rb
Instance Attribute Summary collapse
-
#swift_class ⇒ Object
readonly
Returns the value of attribute swift_class.
Instance Method Summary collapse
- #fake_class_signature ⇒ Object
- #functions ⇒ Object
- #functions_with_args ⇒ Object
- #functions_with_return_value ⇒ Object
- #get_binding ⇒ Object
-
#initialize(swift_class) ⇒ Presenter
constructor
A new instance of Presenter.
Constructor Details
#initialize(swift_class) ⇒ Presenter
Returns a new instance of Presenter.
7 8 9 |
# File 'lib/swiftfake/presenter.rb', line 7 def initialize(swift_class) @swift_class = swift_class end |
Instance Attribute Details
#swift_class ⇒ Object (readonly)
Returns the value of attribute swift_class.
5 6 7 |
# File 'lib/swiftfake/presenter.rb', line 5 def swift_class @swift_class end |
Instance Method Details
#fake_class_signature ⇒ Object
15 16 17 |
# File 'lib/swiftfake/presenter.rb', line 15 def fake_class_signature "#{swift_class.access} class Fake#{swift_class.name}: #{swift_class.name}" end |
#functions ⇒ Object
19 20 21 |
# File 'lib/swiftfake/presenter.rb', line 19 def functions @functions ||= swift_class.functions.map { |f| f.extend(FunctionDecorator) } end |
#functions_with_args ⇒ Object
23 24 25 |
# File 'lib/swiftfake/presenter.rb', line 23 def functions_with_args functions.select(&:has_args?) end |
#functions_with_return_value ⇒ Object
27 28 29 |
# File 'lib/swiftfake/presenter.rb', line 27 def functions_with_return_value functions.select(&:returns?) end |
#get_binding ⇒ Object
11 12 13 |
# File 'lib/swiftfake/presenter.rb', line 11 def get_binding binding() end |