Class: DesignByContract::Signature::Spec
- Inherits:
-
Object
- Object
- DesignByContract::Signature::Spec
- Defined in:
- lib/design_by_contract/signature/spec.rb
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(oth_spec) ⇒ Object
-
#initialize(method_args_spec) ⇒ Spec
constructor
A new instance of Spec.
- #raw ⇒ Object
Constructor Details
#initialize(method_args_spec) ⇒ Spec
Returns a new instance of Spec.
4 5 6 |
# File 'lib/design_by_contract/signature/spec.rb', line 4 def initialize(method_args_spec) @type, @keyword, @interface = format(method_args_spec) end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
2 3 4 |
# File 'lib/design_by_contract/signature/spec.rb', line 2 def interface @interface end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
2 3 4 |
# File 'lib/design_by_contract/signature/spec.rb', line 2 def keyword @keyword end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2 3 4 |
# File 'lib/design_by_contract/signature/spec.rb', line 2 def type @type end |
Instance Method Details
#==(oth_spec) ⇒ Object
8 9 10 11 12 |
# File 'lib/design_by_contract/signature/spec.rb', line 8 def ==(oth_spec) type == oth_spec.type && keyword == oth_spec.keyword && interface == oth_spec.interface end |
#raw ⇒ Object
14 15 16 |
# File 'lib/design_by_contract/signature/spec.rb', line 14 def raw [type, keyword, interface.raw] end |