Class: Keynote::Theme
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: nil, name: nil) ⇒ Theme
constructor
A new instance of Theme.
Methods included from Util
Constructor Details
#initialize(id: nil, name: nil) ⇒ Theme
Returns a new instance of Theme.
9 10 11 12 |
# File 'lib/keynote/theme.rb', line 9 def initialize(id: nil, name: nil) @id = id @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/keynote/theme.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/keynote/theme.rb', line 7 def name @name end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/keynote/theme.rb', line 18 def self.all self.find_with_conditions end |
.default ⇒ Object
14 15 16 |
# File 'lib/keynote/theme.rb', line 14 def self.default self.all.first end |
.find_by(args) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/keynote/theme.rb', line 22 def self.find_by(args) raise ArgumentError.new('nil argument is given') unless args if args.is_a?(Hash) && args.has_key?(:name) conditions = ".whose({ name: '#{args[:name]}' })" else raise ArgumentError.new('Unsupported argument is given') end find_with_conditions(conditions) end |