Class: Rucola::Nib::Classes
Overview
:nodoc:
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #add_class(class_name, superclass_name = 'NSObject') ⇒ Object
- #classes ⇒ Object
- #has_class?(class_name) ⇒ Boolean
-
#initialize(classes_nib_path) ⇒ Classes
constructor
A new instance of Classes.
- #save ⇒ Object
Constructor Details
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
22 23 24 |
# File 'lib/rucola/nib.rb', line 22 def data @data end |
Class Method Details
.open(classes_nib_path) ⇒ Object
24 25 26 |
# File 'lib/rucola/nib.rb', line 24 def self.open(classes_nib_path) new(classes_nib_path) end |
Instance Method Details
#add_class(class_name, superclass_name = 'NSObject') ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/rucola/nib.rb', line 37 def add_class(class_name, superclass_name = 'NSObject') classes.push({ 'CLASS' => class_name, 'SUPERCLASS' => superclass_name, 'LANGUAGE' => 'ObjC' }) end |
#classes ⇒ Object
33 34 35 |
# File 'lib/rucola/nib.rb', line 33 def classes @data['IBClasses'] end |
#has_class?(class_name) ⇒ Boolean
45 46 47 |
# File 'lib/rucola/nib.rb', line 45 def has_class?(class_name) classes.any? { |klass| klass['CLASS'] == class_name } end |