Class: Bootinq::Component
- Inherits:
-
Object
- Object
- Bootinq::Component
- Defined in:
- lib/bootinq/component.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#id2name ⇒ Object
(also: #to_s, #gem_name, #name)
readonly
Returns the value of attribute id2name.
-
#intern ⇒ Object
(also: #to_sym)
readonly
Returns the value of attribute intern.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(other) ⇒ Object
- #casecmp(other) ⇒ Object
- #casecmp?(other) ⇒ Boolean
- #engine ⇒ Object
-
#initialize(intern) ⇒ Component
constructor
A new instance of Component.
- #kind_of?(klass) ⇒ Boolean
- #module_name ⇒ Object
- #mountable? ⇒ Boolean
Constructor Details
#initialize(intern) ⇒ Component
Returns a new instance of Component.
12 13 14 15 16 17 |
# File 'lib/bootinq/component.rb', line 12 def initialize(intern) @intern = intern.to_sym @id2name = intern.to_s.freeze @group = :"#@id2name\_boot" freeze end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
5 6 7 |
# File 'lib/bootinq/component.rb', line 5 def group @group end |
#id2name ⇒ Object (readonly) Also known as: to_s, gem_name, name
Returns the value of attribute id2name.
5 6 7 |
# File 'lib/bootinq/component.rb', line 5 def id2name @id2name end |
#intern ⇒ Object (readonly) Also known as: to_sym
Returns the value of attribute intern.
5 6 7 |
# File 'lib/bootinq/component.rb', line 5 def intern @intern end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/bootinq/component.rb', line 34 def == other case other when String then other == @id2name when Symbol then other == @intern else super end end |
#===(other) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/bootinq/component.rb', line 42 def ===(other) case other when String then other === @id2name when Symbol then other === @intern else super end end |
#casecmp(other) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/bootinq/component.rb', line 50 def casecmp(other) case other when String then @id2name.casecmp(other) when Symbol then @intern.casecmp(other) when self.class then casecmp(other.to_s) end end |
#casecmp?(other) ⇒ Boolean
58 59 60 61 62 63 64 |
# File 'lib/bootinq/component.rb', line 58 def casecmp?(other) case other when String then @id2name.casecmp?(other) when Symbol then @intern.casecmp?(other) when self.class then casecmp?(other.to_s) end end |
#engine ⇒ Object
27 28 |
# File 'lib/bootinq/component.rb', line 27 def engine end |
#kind_of?(klass) ⇒ Boolean
30 31 32 |
# File 'lib/bootinq/component.rb', line 30 def kind_of?(klass) super || @intern.kind_of?(klass) end |
#module_name ⇒ Object
23 24 25 |
# File 'lib/bootinq/component.rb', line 23 def module_name @id2name.camelcase.to_sym end |
#mountable? ⇒ Boolean
19 20 21 |
# File 'lib/bootinq/component.rb', line 19 def mountable? false end |